2
I'm trying to use the Visual Studio editors Regular Expressions to find and replace text using capture-groups, but have run into a problem.
I'm trying to find and capture a set of 5 Alpha-Numerics:
(\w{5})
And search-replace that group to append a "1" after it:
$11
Here I really mean $1
The Captured Group + 1
Text to append
Examples:
227TW ==> 227TW1
1053X ==> 1053X1
However, it obviously interprets $11
as "Capture Group Eleven".
How can I properly make the Search/Replace understand that $1
and 1
are separate elements?
Things I've tried, that failed:
$1(1) : 227TW ==> 227TW(1)
$1\1 : 227TW ==> 227TW\1
$1 1 : 227TW ==> 227TW 1
$1^1 : 227TW ==> 227TW^1
($1)1 : 227TW ==> (227TW)1
1great answer!! Actually I wanted to suggest to step approach, e.g. first replace to
$1##1##
or whatever string you won't find in your input, then replace##1##
to1
– Máté Juhász – 2019-02-04T21:27:23.183