hanickadot / compile-time-regular-expressions

Compile Time Regular Expression in C++
https://twitter.com/hankadusikova
Apache License 2.0
3.22k stars 177 forks source link

incorrect match with repeated group #300

Open faceprint opened 6 months ago

faceprint commented 6 months ago

A regex with a repeated group and a lazy space character doesn't work like I expect. boost and the online regex demo tools behave as expected. Here's as simple an example as I could easily create:

regex: (([A-Z][a-z]+ *?){1,4}) g

The intent is to match 1 to 4 capitalized words in front of a word starting with g.

https://gcc.godbolt.org/z/v6KWrasYv

CTRE fails to match multiple capitalized words, and only matches the last one.

hanickadot commented 6 months ago

Thanks, will look into it. It will take a while as I'm currently swamped.