REGEXP parsing in php3
| From: | Greg Billock | Date: | Tue, 27 Jun 2000 19:27:53 +0000 |
| Subject: | REGEXP parsing in php3 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3417@lists.php.net to get a copy of this message | ||
I am experiencing some oddnesses relating to regexp parsing between
v3.0.11 and v3.0.12 in regexps. I have the following regexp that
interpolates a URL with a link:
$ostring =
ereg_replace("(http\:\/\/[[:alnum:]]+\.[[:alnum:]]+[^[:space:]]*?)","<A
HREF=\"\\1\">\\1</A>", $ostring);
This works in 3.0.12, but gives a BADRPT error in 3.0.11, which indicates
that a repetition operator (like '*' or '+' is misplaced).
A very similar regexp for email addresses works fine in both.
$ostring = ereg_replace("([[:alnum:]]+\@[[:alnum:]]+\.[[:alnum:]]+)","<A
HREF=\"mailto:\\1\">\\1</A>", $ostring);
What am I missing, or is there something I couldn't find in the changelog about
updates to regexp parsing in 3.0.12?
-Greg