Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace current regex engine with PCRE2 #4185

Merged
merged 3 commits into from
Feb 5, 2024
Merged

Replace current regex engine with PCRE2 #4185

merged 3 commits into from
Feb 5, 2024

Commits on Feb 3, 2024

  1. Replace OpenBSD regex library with PCRE2.

    PCRE2 has way better performance than the OpenBSD
    library (something around 20 times faster).
    
    The following flags are enabled for every pattern:
    
    - PCRE2_UTF
    - PCRE2_MATCH_INVALID_UTF
    - PCRE2_NO_UTF_CHECK
    
    All the others are optional.
    
    Changes made:
    
    - Adds PCRE2 as subproject.
    - Changes the API away from POSIX to PCRE2.
    - Edits many regex patterns because:
     - ' ' is skipped in patterns, if the EXTENDED flag is set for matching. '\s' must be set now.
     - '.' doesn't match newlines by default.
    - Changes the API so matches and their groups are bundled into PVectors.
    - Moves the regex component to rz_util.
    Rot127 committed Feb 3, 2024
    Configuration menu
    Copy the full SHA
    d11a763 View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2024

  1. Test for POSIX blank.

    Rot127 committed Feb 4, 2024
    Configuration menu
    Copy the full SHA
    e9d3720 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2024

  1. Fix cross build - add copy of PCRE2 dependecy

    Meson currently doesn't support subprojects to be native and non-native at the same time.
    See: mesonbuild/meson#10947
    Unfortunately, sdb depends on rz_util which in turn depends on PCRE2.
    Excluding PCRE2 from the native build makes linking of rz_util not possible anymore.
    Adding it, will make Meson complain that the dependencies cannot be mixed.
    
    Hence, we compile a copy of PCRE2 for the native build if required.
    Rot127 committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    4ecb0fd View commit details
    Browse the repository at this point in the history