简体   繁体   中英

notepad regular expression replacement

Essentially I have a set of name like

name1,
name2,
name3,

and I'd like to make it via find & replacement in notepad++

name1 = name1,
name2 = name2,
name3 = name3,

I have no problem find those name1 name2 in Find what:

[^\s,]+

But in Replace with , what should I do to replace ',' with "= whatever being find ," ?

Thanks

Find what (assuming your regex finds what you want correctly): [^\\s,]+

Replace with: $0 = $0

$0 means everything matched by the expression in "Find what"

You can try using the following regex on search field:

^(\\w+\\d),

and the replace field:

$1 = $1,

Hope it help you!

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