user3001909
user3001909

Reputation: 351

Search and replace with Notepad++ regex

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

Answers (1)

Casimir et Hippolyte
Casimir et Hippolyte

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

Related Questions