[erlang-questions] backquotes in re:replace/3

Vance Shipley <>
Thu Mar 8 16:58:19 CET 2012


Is there a syntax supported which allows us to insert a back
reference in a replacement followed directly by digits?  I
haven't found one yet.

   Eshell V5.9  (abort with ^G)
   1> re:replace("012345", "0(...)45", "\\1bcde").
   [[<<"123">>,<<"bcde">>]]
   2> re:replace("012345", "0(...)45", "\\16789").
   [[<<>>]]
   3> re:replace("012345", "0(...)45", "\\g{1}6789").
   [<<"g{1}6789">>]


-- 
	-Vance



More information about the erlang-questions mailing list