I'm after a regular expression that looks through a string for a
certain code, and then replaces part of that code with some markup:
So look in this string:
this text contains (T123) a code.
And become this string
this text contains (T<a href="?a=123">T123</a>) a code.
The main problem I'm having is that my regexp replaces the whole
match, including the T:
$pattern='(T[0-9]{3})';
$replace='<a href="?a=\1">\1</a>';
This results in a hyperlink "?a=T123" when I want ?a=123
Any suggestions?
Thanks,
Mark