notepad++ - regex substitute two patterns in one match -


i'm trying find/replace in notepad++ string similar

<span class="charoverride-1">q</span> 

with single replace command i'd result

<span class="somethingnew">somethingelse</span> 

this matches 2 things want replaced don't know how form substitution

(?<=<span class="(charoverride-1)">)(q)(?=<\/span>) 

if possible i'd avoid doing

(<span class=")(charoverride-1)(">)(q)(<\/span>)    ,  \1somethingnew\3somethingelse\5 

you can simlpy use 3 captures groups:

search:

(<span class=").*?(">).*?(</span>) 

replace:

\1somethingnew\2somethingelse\3 

don't forget check "regular expression" checkbox.

but, if can give personal advice: don't use notepad++...


Comments