The 1 while resursive subsitution trick is useful for this sort of problem. See my example above. I prefer a negated char class ie [^\]] in this example to an un-greedy .+? as it saves backtracking +/- improves accuracy as it is slightly more specific and it allows \n for example where . does not by default.
Lots of ways to skin the cat, provided we can make a nice tasty stew TIMTOWDI.
cheers
tachyon
In reply to Re^2: Regex help
by tachyon
in thread Regex help
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |