Page 1 of 1

Replace the text with searched text with \1

Posted: 24.12.2019 08:40
by hycmos
For example,
original text: 12.3
wanted text: 1.23

So I Ctrl+R, (click option:regular expressions)
Find input-box:(\d)\.
Replace input-box:\.\1

but the result is:1.13 not 1.23

Posted: 24.12.2019 12:26
by Alexey
Docs for regex
https://regex.sorokin.engineer/en/lates ... substitute
shows that you must use $1, not \1.

Posted: 25.12.2019 00:58
by hycmos
Thanks.
I don't know the symbol '$1' is used to denote the subexpression 1.
I used '\1' for that.

Posted: 25.12.2019 06:02
by Alexey
\1 is used in Regex (backreference). $1 is used in "replace with".