Bad Regex string replacement when followed by number

You found an error in the program ? Report it here
Post Reply
laurent
Posts: 1
Joined: 2016-06-13 15:20:16

Bad Regex string replacement when followed by number

Post 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
antp
Site Admin
Posts: 9651
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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".
Post Reply