http://qs321.pair.com?node_id=592518


in reply to Split tags and words nicely

This looks like html, but maybe it's not.

If it's html, the other suggestions are good.

Otherwise, if you need to do something "regex like" but need more power than regexes can give you, the next step is to fire up Parse::RecDescent .

This should also become easier when perl6 goes production. There, you get all the powers of Parse::RecDescent bundled into the same syntactic sugar perlers are used to with =~ for regexes.