Re: Echo Regular Expression Pattern

From: Date: Thu, 10 Oct 2002 17:01:05 +0000
Subject: Re: Echo Regular Expression Pattern
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-119556@lists.php.net to get a copy of this message
Nevermind. This works: ereg("Q+[0-9]{6}",$Data[$n],$qarticle); $GetLine = explode("\r", ereg_replace("Q+[0-9]{6}","<a href=\"http://support.microsoft.com/default.aspx?scid=kb;[LN];$qarticle[0]\" target=\"blank\">$qarticle[0]</a>",$Data[$n])); "Mike Smith" <msmith@larrymethvin.com> wrote in message news:20021010164058.71362.qmail@pb1.pair.com... > 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=\"óüG–œÕæ×Y•Ô¬ > qhttp://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 > >

« previous php.general (#119556) next »