Reply to Re: More Regex

Your name:

Reply:


Posted by Michael Fesser on 03/01/07 22:54

..oO(Damo)

>I was reading through someone else s code earlier and I came across
>this regex
>
>$regex = '%src="(?!http://)%';
>
>I cant figure out what it does. The ? is a greedy quantifier is it not
>and should be after http://............. or is that rubbish

The ? is used in many places for many different things. In combination
with a ! like in this case it's called a negative lookahead assertion.

http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

So the regex above matches all src=", that are not followed by http://.

Micha

[Back to original 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

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