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

The `.` and multi-line support. #105

Closed al6x closed 3 years ago

al6x commented 3 years ago

There's different ways regex libraries threat the . character. Like if newline flag is set on or off. The snippet from the docs of nim-regex

. any character except new line (includes new line with s flag)

I personally find it more confusion than help (like the need to use [\s\S] in JavaScript).

Wouldn't it be better to make it more consistent? And make the . to consistently and always match ANY character?

nitely commented 3 years ago

Yes, but this library keeps compatibility with PCRE as much as possible,