nitely / nim-regex

Pure Nim regex engine. Guarantees linear time matching
https://nitely.github.io/nim-regex/
MIT License
227 stars 20 forks source link

Inject named groups as vars into match macro scope #93

Open nitely opened 3 years ago

nitely commented 3 years ago

ex:

match "1-2 c abc", rex"(?P<a>\d+)-(?P<b>\d+) (?P<c>\w): (?P<pwd>\w*)":
  doAssert a == "1"
  doAssert b == "2"
  doAssert c == "c"
  doAssert pwd == "abc"