How to differentiate a regular expression group number in a notepad ++ replacement?

I want to indicate the captured group and then the literal digit in the replacement member, but the literal digit is interpreted as part of the group number.

Given this (far-fetched) example:

Input text: A5
Find: (.)(.)
Replace: $16
Expected result: A6
Actual result: <blank>
The experiment suggests that it is $16interpreted as "group 16".

I tried to use $1\6to make a literal 6that gave me group 1, but a space for \6- that is, the result was simple A. $1\\6gave me A\6.

General question: "How to specify group 1, and then a literal number"?

+4
source share
1 answer

Notepad S & R regex regex Boost.

$n ({}) , ${1}6 .

Notepad ++ BRE, \ (\1, \2 .. * 9). , \16 , Backreference 1 + 6. , (.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.) \11 1234567890A. A (11- ) 11 . $11 A.

Notepad ++ help , :

$n, ${n}, \n
, n. .

+5

Source: https://habr.com/ru/post/1653381/


All Articles