Reply to Re: Reg. Ex. Problem

Your name:

Reply:


Posted by Alvaro G. Vicario on 08/11/06 20:22

*** ctiggerf escribió/wrote (11 Aug 2006 10:41:02 -0700):
> Well, I spent something like 10 hrs farting with this before I posted.
> I guess I just needed 1 more hour after playing with it.

That always happens to me too :)


> $pattern="/href=(\"|').*?{{(".$id.")}}.*?\\1/i";

> {{####}} needed to be {{(####)}} - Not exactly sure why, but my guess
> was that it thought {{111}} was a quantifier

Yep, { and } are meta-characters and should be escaped when not used as
such:

{ = start min/max quantifier
} = end min/max quantifier

You have a full list in PHP manual:

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

It should be:

\{ and \}




--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--

[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

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