in reply to Re: regex help humbly sought
in thread regex help humbly sought

.*? is perfectly legitimate in a Perl regex. Search for "non-greedy" sometime.

Your solution is great if the input actually has the tags in question conveniently on lines by themselves, but breaks otherwise. If you've ever worked with real users, you know that's unlikely unless the input was purely machine generated with that constraint in mind and never touched by the users.