in reply to Matching delimiters
Anyway, I'd probably write the regex a little differently -- this would behave a bit different from the OP version, in allowing the input to have an empty string (i.e. nothing) inside the curly braces (whereas the OP would not match unless there's at least one character in there):
That also works on the sample input string you originally posted. If you have a string that doesn't work with that, show us.s# \\ (caption) \{ ([^}]*) \} #<$1>$2</$1>#gisx;
|
|---|