Hello,
I'm trying to write an expression that will match lines like this:
This is [a] a line[/a] with text
This [w] is also a[/w] a line
but not lines like:
This [a] shall not[/w] match
My expression looks like this:
preg_match("/(.*)\[(.)\](.+)\[\/\2\](.*)/",$line,$matches)
But it does not match. I have tried to replace \2 part of the string above
with a . and then it match.
If I'm correct, the \2 should referre to the character matched by the .
inside the []... or?
Thanx in advace.
--
Jørn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/index.php