nim-regex icon indicating copy to clipboard operation
nim-regex copied to clipboard

`$1` incorrectly accepted when it doesn't refer to a capture

Open timotheecour opened this issue 7 years ago • 0 comments

import pkg/regex

when defined(case2):
  # BUG: abc$2def instead of error as in case3b (should use "$$2" if that's what user wants)
  echo "abcfoodef".replace(re"foo", "$2")

when defined(case3b):
  # OK: RT error: invalidFormatString
  echo "abcfoodef".replace(re"f(o)o", "[$2]")

timotheecour avatar Oct 08 '18 23:10 timotheecour