Is there a way to perform multiple search and replace using Regular expresion? I have strings:
aaa
bbb
ccc
across the plain text, and I want to replace them
aaa to replace with ddd
bbb to replace with eee
ccc to replace with fff
Is there a regular expression to do that at once, using one single regex?
I am using Notepad++
https://notepad-plus-plus.org/community/topic/11385/how-to-multi-replace
The general syntax is:
Find: (FindA)|(FindB)|(FindC)...
Replace: (?1ReplaceA)(?2ReplaceB)(?3ReplaceC)...
Notes: Be sure that the Regular expression search mode is checked
For instance:
(aaa)|(ccc)|(eee)|(123)
(?1bbb)(?2ddd)(?3fff)(?{4}456)
gives:
aaa
is changed into bbb
ccc
is changed into ddd
eee
is changed into fff
123
is changed into 456
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.