- Original Message -
From: "Gerard Samuel" <[EMAIL PROTECTED]>
To: "Greg Beaver" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 09, 2003 12:24 AM
Subject: Re: [PHP] Re: Dynamic Regex
What you suggested is what I was trying before
uel" <[EMAIL PROTECTED]>
To: "Greg Beaver" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 09, 2003 12:24 AM
Subject: Re: [PHP] Re: Dynamic Regex
> What you suggested is what I was trying before. My original example
> was incorrect.
What you suggested is what I was trying before. My original example
was incorrect.
Here is an good example for the variable holding the pattern ->
$foo = '/\[url\]([a-z]+://.*?)\[/url\]/';
This pattern would not work, but if I change it to
$foo = '#\[url\]([a-z]+://.*?)\[/url\]#';
It does work.
Hi Gerard,
all the preg_* functions require delimiters surrounding regular expressions.
$foo = '\[this\](.*?)that';
should be by default:
$foo = '/\[this\](.*?)that/';
the code you tried uses # as the delimiter instead of /, an option preg_*
allows
Take care,
Greg
--
phpDocumentor
http://www.
4 matches
Mail list logo