compile-time-regular-expressions
compile-time-regular-expressions copied to clipboard
Compile Time Regular Expression in C++
There is no mention anywhere that "." behaves as in "dotall" mode in PCRE, i.e. matches _everything_, including new line and I'm not sure if this is intentional, but this...
This can be replaced by `(.|\n)`, but normally this should work too, quoting from https://en.cppreference.com/w/cpp/regex/ecmascript CharacterClass :: [ [ lookahead ∉ {^}] ClassRanges ] [ ^ ClassRanges ] ClassRanges ::...
Thanks for the impressive library, but trying to migrate my existing code using Boost.Regex to it, I ran into the following problem: there currently doesn't seem to be any equivalent...
I would like to see added a way to combine multiple regexes. I can see this working either with the fixed strings for regexes - or with the built regexes...
His notes: * Utilize [[nodiscard]] at least in the public facing functions * Consider some explicit for your constructors * Are there missing test cases eluded to by the unused...
I have a regex: "(?=((?:55|66)[0-9a-fA-F]{8,}\r))". That will for this input: "550020660232020202125\r", And std::sregex_iterator will return 2 matches: - 550020660232020202125\r - 660232020202125\r But ctre::range will only return "" and will never...
It looks like you've added functions for tokenizing / lexing. It might be useful to have a helper function to iterate across captures and/or to keep track of the first...
The STL has a match_results::position() function that returns the position of the match in the string. https://www.cplusplus.com/reference/regex/match_results/position/ This could possibly be implemented via subtracting 2 pointers. ```c++ const char *...
There is a regression somewhere (I haven't had the time yet to debug this) since v3.2 where some of the expressions I'm using are no longer matching. Working commit: https://github.com/hanickadot/compile-time-regular-expressions/commit/46a345e7faba8497f585ce5d180b5cb4f6a00544
Does not compile: ```cpp static_assert("\\A((.|QM){1}\\Z)"_ctre.search("QM")); static_assert("\\A((.|(QM)){1}\\Z)"_ctre.search("QM")); ``` Compiles: ```cpp static_assert("\\A((.|QM)\\Z)"_ctre.search("QM")); static_assert("\\A((.|Q){1}\\Z)"_ctre.search("Q")); static_assert("\\A((QM){1}\\Z)"_ctre.search("QM")); static_assert("((.|QM){1}\\Z)"_ctre.search("QM")); static_assert("(\\A(.|QM){1})"_ctre.search("QM")); ``` https://gcc.godbolt.org/z/rfsP6d