asp.net.ph

Skip Navigation Links

Substitutions

Regular Expressions Language Elements


Substitutions are allowed only within replacement patterns. For similar functionality within regular expressions, use a backreference ( for example, \1 ). For details on backreferences, see Backreferences and Backreference Constructs.

Character escapes and substitutions are the only special constructs recognized in a replacement pattern. All the syntactic constructs described in the following sections are allowed only in regular expressions; they are not recognized in replacement patterns. For example, the replacement pattern a*${txt}b inserts the string a* followed by the substring matched by the "txt" capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern. Similarly, $ patterns are not recognized within regular expression matching patterns. Within regular expressions, $ designates the end of the string. For example:

Character Meaning
$123 Substitutes the last substring matched by group number 123 ( decimal ).
${name} Substitutes the last substring matched by a ( ?<name> ) group.

See Also

ASP.NET Page Syntax



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note