From 264e667b86381528131c45c9b6e8f54ad168c73f Mon Sep 17 00:00:00 2001 From: Vance Shipley Date: Wed, 4 Apr 2012 18:17:33 +0530 Subject: extend re back reference syntax with \g escape sequence Add the \gN and \g{N} syntax for back references in re:replace/3,4 to allow use with numeric replacement strings. --- lib/stdlib/doc/src/re.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/re.xml b/lib/stdlib/doc/src/re.xml index 6d5336796c..224b4b2771 100644 --- a/lib/stdlib/doc/src/re.xml +++ b/lib/stdlib/doc/src/re.xml @@ -524,8 +524,8 @@ This option makes it possible to include comments inside complicated patterns. N

The replacement string can contain the special character &, which inserts the whole matching expression in the - result, and the special sequence \N (where N is an - integer > 0), resulting in the subexpression number N will be + result, and the special sequence \N (where N is an integer > 0), + \gN or \g{N} resulting in the subexpression number N will be inserted in the result. If no subexpression with that number is generated by the regular expression, nothing is inserted.

To insert an & or \ in the result, precede it -- cgit v1.2.3