Echo Regular Expression Pattern
| From: | Mike Smith | Date: | Thu, 10 Oct 2002 16:40:57 +0000 |
| Subject: | Echo Regular Expression Pattern | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-119554@lists.php.net to get a copy of this message | ||
I'm trying to return a pattern found in a regular expression. I can find the
Expression (Q followed by 6 numbers, yes MS Q articles) using this:
$GetLine = explode("\r", ereg_replace("Q+[0-9]{6}","<a
href=\"http://support.microsoft.com/default.aspx?scid=kb;[LN];Q+[0-9]{6}\"
target=\"blank\">'Q+[0-9]{6}'</a>",$Data[$n]));
I'm basically trying to find the pattern and 'replace' it with itself as a
clickable link to MS's Q articles so I need to insert "Q+[0-9]{6}" after
[LN]; in the href and then again as the text of the link. The script runs
but produces:
http://support.microsoft.com/default.aspx?scid=kb;[LN];Q+[0-9]{6}
and echos
Q+[0-9]{6} as the clickable link.
Thanks,
Mike Smith