I‘ve got some text like this:
prefix:hello1_Th2ere_a3nd_Ther4e
and I want to change these text to:
prefix:Hello1Th2ereA3ndTher4e
and I am trying to run follow command:
:1,$s/prefix:\(\([a-z]\)\([a-zA-Z0-9]\+\)_\)\+\([a-z]\)\([a-zA-Z0-9]\+\)/???
then I have no idea how to fill “???”
We can refer to content in quote of regex by “\1\2” when the quote is unnested, But what to do when the quote is nested.
This is normally done by two nested substitutes:
Note that you regular expression does not match the example string: “T” in “Th2ere” and “Ther4e” does not match
[a-z]hence I replaced it with[a-zA-Z].