Hi There!
I’m trying to generate this output using a snippet:
replacementone
replacementtwo
Replacement:
AAReplacementoneBBBReplacementtwoDDDD
Standalone:
Replacementtwo
Using the following snippet:
${1:replacementone}
${2:replacementtwo}
Replacement:
AA${1/(\w+)/\u$1/g}BBB${2/(\w+)/\u$2/g}DDDD
Standalone:
${2/(\w+)/\u$2/g}
However, when I run it I only get the first replacement to work…
replacementone
replacementtwo
Replacement:
AAReplacementoneBBBDDDD
Standalone:
The field for replacementone works but the other one goes unrecognized…
Any help would be greatly appreciated!
Thanks!
Edit:
If I use only use the replacement of the first field it works as intended… I.e. If the snippet is
${1:replacementone}
${2:replacementtwo}
Replacement:
AA${1/(\w+)/\u$1/g}BBB${1/(\w+)/\u$1/g}DDDD
Standalone:
${1/(\w+)/\u$1/g}
Then the output is
replacementone
replacementtwo
Replacement:
AAReplacementoneBBBReplacementoneDDDD
Standalone:
Replacementone
Edit 2:
I’ve tried changing the flags, with i, ig, g, and none but no avail, this is driving me insane.