> I'm trying to work out the regex needed to split either one of the
> following lines
>
> Windows 2000 Hotfix (Pre-SP4) See Q322842 for more information
> Windows XP Hotfix (SP2) See Q327696 for more information
>
> Into one of these
>
> Windows 2000 Hotfix (Pre-SP4) See <a
> href='http://support.microsoft.com/default.aspx?scid=kb;en-us;Q322842'>Q
> 322842</a> for more information
> Windows XP Hotfix (SP2) See <a
> href='http://support.microsoft.com/default.aspx?scid=kb;en-us;Q327696>Q3
> 27696</a> for more information

$new_string =
preg_replace("/Q[0-9]{6}/","urlgoeshere/default.aspx?scid=kb;en-us;$1",$old_
string);

I didn't put the actual URL because OE mangles it and turns it into a link.
Hopefully that helps.

You can use Q|q or /Q[0-9]{6}/i to make it case insensitive, too, if you
want.

---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to