Posted by gosha bine on 05/14/07 20:38
dr_phill123@yahoo.com wrote:
> The following code gives this warning, any suggestions?
>
> Warning: preg_match(): Compilation failed: nothing to repeat at
> offset 0 in test.php on line 6
>
> =========================
>
> $match = '* Hello World';
> $test = '* Hello';
>
> if ( preg_match ( "/$match/", $test ) ) echo "Matched";
>
* means "repeat previous character". In your expr, * goes first, hence
the warning. What are you trying to find with this expression?
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
[Back to original message]
|