Compile time regular expression in C++

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • cl-ppcre

    Common Lisp regular expression library

  • I've never used cl-ppcre myself, but its docs[1] claim that it provides compile-time regexes:

    > CL-PPCRE uses compiler macros to pre-compile scanners at load time if possible. This happens if the compiler can determine that the regular expression (no matter if it's a string or an S-expression) is constant at compile time and is intended to save the time for creating scanners at execution time (probably creating the same scanner over and over in a loop).

    [1]: https://edicl.github.io/cl-ppcre/

  • compile-time-regular-expressions

    Compile Time Regular Expression in C++

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • rebar

    A biased barometer for gauging the relative speed of some regex engines on a curated set of tasks.

  • I'd love for someone to add this to rebar[1] so that we can get a good sense of how well it does against other general purpose regex engines. It will be a little tricky to add (since the build step will require emitting a C++ program and compiling it), but it should be possible.

    [1]: https://github.com/BurntSushi/rebar

  • ctregex.zig

    Compile time regular expressions in zig

  • Since other people are posting other lang implementations... someone did it for zig too (probably less polished than this C++ lib) [1]. It is nice that the regexes can be used at compile time too ().

    --

    : I think the difference between C++ template language and Zig comptime is that Zig's comptime is almost equal as Zig's regular language, whereas the experience of programming C++ templates almost feels like learning a separate, equally complex language.

    1: https://github.com/alexnask/ctregex.zig

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts