Skip to content

Releases: hanickadot/compile-time-regular-expressions

housecleaning

08 Nov 08:12
Compare
Choose a tag to compare
  • fix for negative unicode properties in ranges
  • ctre::range now supports utf8 u8string iteration

remove a debug function

07 Nov 17:09
Compare
Choose a tag to compare

sorry 🤷🏻‍♀️

Nested cycles and optional support (inline fix)

07 Nov 15:07
Compare
Choose a tag to compare

Fixes regression #131.

  • prepare infrastructure for flags (case insensitiveness, multi-line support)
  • new string comparison without recursion

Nested cycles and optional support

07 Nov 14:43
a85f36d
Compare
Choose a tag to compare

Fixes regression #131.

  • prepare infrastructure for flags (case insensitiveness, multi-line support)

unicode fixes

18 Oct 20:49
Compare
Choose a tag to compare
  • 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)

17 Oct 13:59
2902ada
Compare
Choose a tag to compare

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

16 Oct 10:29
Compare
Choose a tag to compare

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

09 Sep 07:34
Compare
Choose a tag to compare
  • support for starts_with which is equivalent to search<"^...">
  • 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

23 Jul 20:19
Compare
Choose a tag to compare

quicker captures

22 May 09:41
Compare
Choose a tag to compare
  • 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)