Reputation: 351
I am trying to replace this piece of code :
<Group>
<Group type="level"/>
<Group type="started"/>
</Group>
I tried this regex
<Group>(*.?)</Group>
but its not working . Any one has a solution ?
Upvotes: 0
Views: 142
Reputation: 89547
This doesn't work because the .
doesn't match newlines. You can replace it with [\s\S]
or add (?s)
at the begining of the pattern (or before the dot) to set the dotall mode (where newlines are matched with .
too):
<Group>(?s)(.*?)</Group>
<Group>([\s\S]*?)</Group>
<Group>(.*?)</Group> # with the dotall checkbox checked
note: you have inverted the position of the dot with the position of the quantifier.
Upvotes: 2