Posted by dr_phill123 on 05/14/07 21:01
Thomas Mlynarczyk wrote:
> The * is a special character in regular expressions, but here you want to
> use it as a normal one. So it must be escaped: '\* Hello World'. And I think
> you mixed up the parameters. This should work:
Thanks that is a good solution. Another one I discovered is to use \Q
as
in. The \Q escapes the whole string. I just remembered it from my
perl
days...
if ( preg_match ( "/\Q$match/", $test ) ) echo "Matched";
Navigation:
[Reply to this message]
|