Page 1 of 1

Bad Regex string replacement when followed by number

Posted: 2016-06-13 15:34:16
by laurent
Hi
using $1 or $2 etc before a digit in string replacement causes a bad behavior.

For example using $12 creates an empty string as if Ant Renamer does not translate "$1 followed by a 2" but $"twelve" which is not defined.

Pb with regex engine ? with AntRenamer ?

Thx

Posted: 2016-06-13 16:12:35
by antp
Hi,
Indeed, it can't tell the difference between the two possibilities.
It seems to work if you put a \ before the number to keep, e.g. $1\2 will do "group 1 followed by the digit 2".