How to match nested tags?

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
mathewzhao
Forum Newbie
Posts: 1
Joined: Sat Apr 25, 2009 2:01 am

How to match nested tags?

Post by mathewzhao »

Hi,
A string has the following style.
I want to use regex(perl) to match it,but it's beyond my ability.
Could someone give me a hand?
Thanks!

<AAA
111
222
<AAA
333
444
/AAA>
555
666
/AAA>
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: How to match nested tags?

Post by prometheuzz »

Code: Select all

/(?s).*/
Post Reply