nitely / nim-regex

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

Implement captured API to avoid reNonCapture usage #124

Open nitely opened 11 months ago

nitely commented 11 months ago

Doing text[group(m, x)] for both empty-match/non-match returns an empty string. The current way to check if group(m, x) matched is to do group(m, x) != reNonCapture. I think it would be better to provide a captured(m, x) API which internally just does group(m, x) != reNonCapture.

There is probably a better API name. Maybe wasCaptured