my text is :
<Parag 1 Lev="All">
text All
</Parag1>
<Parag 2 Lev="That">
text That
</Parag2>
<Parag 3 Lev="Com">
text Com in tag 3
</Parag3>
<Parag 4 Lev="All">
text All
</Parag4>
<Parag 5 Lev="All">
text All
</Parag5>
<Parag 6 Lev="Com">
text Com in tag 6
</Parag6>
<Parag 7 Lev="That">
text That
</Parag7>
1- How can I get text between tags with Lev=”Com” with regular expression ? for example : text Com in tag 3 or text Com in tag 6
Please change my Expr : ("Com">)[\d\D]+(</)
2- How can I get tags with regular expression ? for example : <Parag 1 Lev="All"> or </Parag1> or <Parag 3 Lev="Com"> or </Parag3>
Please change(or merge) my Exprs : (<Parag.*?>)(</Parag.*?>)
Thank’s.
Your pattern could be:
The text will be in group 1. Depending on your pattern tool you may need to allow pattern matching over endlines:
Second question: