简体   繁体   中英

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM