import re
import regex
let s = r"(\d+)\.(\d+)(\.(\d+)|)(\.(\d+)|)"
let rx1 = re.re(s)
let rx2 = regex.re(s)
Output:
nim compile --verbosity:0 --hints:off --run "/home/unikum/Projects/Nim/nim-uap/test.nim"
/home/unikum/Projects/Nim/test.nim(6) test
/home/unikum/.nimble/pkgs/regex-0.19.0/regex.nim(283) re
/home/unikum/.nimble/pkgs/regex-0.19.0/regex/compiler.nim(15) reImpl
/home/unikum/.nimble/pkgs/regex-0.19.0/regex/nfa.nim(316) nfa2
/home/unikum/.nimble/pkgs/regex-0.19.0/regex/nfa.nim(77) eNfa
/usr/lib/nim/system.nim(1837) pop
/usr/lib/nim/system/fatal.nim(49) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]
Error: execution of an external program failed: '/home/unikum/Projects/Nim/test '
I faced with error on some regexes.
Minimal example:
Output: