Releases: hanickadot/compile-time-regular-expressions
Releases · hanickadot/compile-time-regular-expressions
housecleaning
- fix for negative unicode properties in ranges
- ctre::range now supports utf8 u8string iteration
remove a debug function
sorry 🤷🏻♀️
Nested cycles and optional support (inline fix)
Fixes regression #131.
- prepare infrastructure for flags (case insensitiveness, multi-line support)
- new string comparison without recursion
Nested cycles and optional support
Fixes regression #131.
- prepare infrastructure for flags (case insensitiveness, multi-line support)
unicode fixes
- update unicode database for missing scripts
- fix in
ctre::utf8_iterator::operator*
for multibyte characters for characters which have highest bit in first UTF8 unit used - remove LIKELY/UNLIKELY for older GCC to remove warning
- fix missing rotated comparison of utf8_iterator and sentinel
std::u8string support (with utf8_iterator)
Now you can use std::u8string and std::u8string_view with CTRE! 🎉
std::optional<std::u8string> match(std::u8string_view subject) {
if (auto res = ctre::match<"(\\p{emoji}+)">(subject)) {
return res.get<1>().to_string();
} else {
return std::nullopt;
}
}
Also you can use ctre::utf8_range
to convert between unicode encodings:
std::u32string convert(std::u8string_view input) {
auto r = ctre::utf8_range(input);
return std::u32string(r.begin(), r.end());
}
Optional Unicode Support
If you include <unicode-db.hpp>
CTRE will support unicode properties. If you don't want to include two headers, you can just include <ctre-unicode.hpp>
.
Have fun! 🤯
Thanks to @cor3ntin for making it possible. ❤️
Better optimizations for search
- support for
starts_with
which is equivalent tosearch<"^...">
- enable optimising
search<"^...">
to generate better assembly (https://compiler-explorer.com/z/nvjG4E) - added vertical and horizontal white space (
\v
,\V
,\h
,\H
)
std::data() and std::size() support
quicker captures
- new code for extracting capture content with
result.get<...>()
functions, which should instantiate O(1) on C++20 compatible compilers with CNTTP
simple benchmark on GCC shows 50% better compile time in capture heavy code (tests/gets.cpp
)