|
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
--
Navigation:
[Reply to this message]
|