Export (0) Print
Expand All
1 out of 4 rated this helpful - Rate this topic

Backreference Constructs 

The following table lists optional parameters that add backreference modifiers to a regular expression.

Backreference construct Definition


Backreference. For example, (\w)\1 finds doubled word characters.


Named backreference. For example, (?<char>\w)\k<char> finds doubled word characters. The expression (?<43>\w)\43 does the same. You can use single quotes instead of angle brackets; for example, \k'char'.

Note the ambiguity between octal escape codes and \number backreferences that use the same notation. See Backreferences for details on how the regular expression engine resolves the ambiguity.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.