PHP Regex using the \Q \E syntax -
I am reading and it says: all the letters between Q ~! @ # $% ^ & Amp; () _ + |} {? & Gt; & Lt; / /] \ "[':'; \ E \ '; string =' ~! @ # $% ^ & Amp;;; * () _ + |} {& gt; & lt ;, / ] [": ';';?. Preg_match ($ patterns, $ string, $ matches); Echo "& lt; east & gt;"; Print_r (matches $); Echo "& lt; / pre & gt;"; This gives me an error: Why is it not working as described above? You forgot to cite your \ q and \ e are interpreted The literal letter like
$ pattern = '/ \ \ * * \ d + * \ E matches the literal text * \ d + *.
Parse error: syntax error, unexpected '~' in / application / XAMPP / Ximpipil / HTTox / xampp / web_development / NEU_Stridi_2014 / REJX.FPP on line 3
' inside the pattern:
$ pattern = '/ \ Q ~! @ # $% ^ & Amp; ; * () _ + |} {? & Gt; & Lt ;, / \] [": '; \ E /'; ^ - Start String # 1 ^ - End String # 1 ^ - Start String # 2 $ String = '~! @ # $% ^ & Amp; * () _ + |} {? & Gt; & lt ;, / \] [':'; '; ^ --- End of string # 2 --- --- Your error, because it is outside the string
Comments
Post a Comment