You are here: Re: Regex with a '*' in it? « PHP Programming Language « IT news, forums, messages
Re: Regex with a '*' in it?

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация