I'd recommend this fine paper as a starting point for your investigations. I would continue with Regexp::Debugger, which is more recent.
And I like choice 3 in your original example, although the star suggests you might have '<>' in your input, which I would guess is unlikely. If the tag's empty, there's not much point in outputting it.
In reply to Re: Difference between these regexes
by talexb
in thread Difference between these regexes
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |