简体   繁体   中英

Regex replace text with < in Notepad++

I am having a hard time with replacing this text with something else . This XML uses also next lines .

     <Need>
        <Need type="money" amount="100"/>
     </Need>

I have tried it with this :

<Need>([\n]*[a-Z]*)</Need>

<Need>(?:[^\n]*(\n+))+</Need>

<Need>([^\n]*[0->]*[a-Z]*)</Need>

<Need>([^\n]*[a-Z]*)</Need>

Non of them worked and 2 deleted the whole text :( .

Find:

<Need>(.*?)</Need>

Replace by:

$1

Be sure that:

  • regular expression is checked.
  • . (dot) matches newline is checked.

使用它进行广泛的搜索并考虑空格和换行符进行替换。

[\s]*<Need>[\r\s]*<Need[^/]*/>[\r\s]*</Need>

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