BUG: Replacement group should ignore consecutive digits
-
- Posts: 2
- Joined: Mon May 18, 2015 11:45 am
BUG: Replacement group should ignore consecutive digits
If you enter a replacement string along the lines of $12$2 the output should be the first matched group followed by a 2 then the second matched group, but it is actually $12 followed by the second matched group. TextCrawler is incorrectly parsing the replacement string, presumably treating the $12 as group 12 rather than group 1 followed by a completely un-related digit 2.
- DigitalVolcano
- Site Admin
- Posts: 1863
- Joined: Thu Jun 09, 2011 10:04 am
Re: BUG: Replacement group should ignore consecutive digits
I think this is by design in the .NET regular expression engine.
More info here:
https://msdn.microsoft.com/en-us/librar ... x#Numbered
You can avoid this problem by putting braces around the group number:
hope this helps!
More info here:
https://msdn.microsoft.com/en-us/librar ... x#Numbered
You can avoid this problem by putting braces around the group number:
Code: Select all
${1}2${2}
-
- Posts: 2
- Joined: Mon May 18, 2015 11:45 am
Re: BUG: Replacement group should ignore consecutive digits
Yes, the braces fix it.
Thanks
Thanks