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

Modularize regex backend, add fancy-regex support #36

Merged
merged 14 commits into from
Feb 21, 2021

Conversation

bminixhofer
Copy link
Owner

@bminixhofer bminixhofer commented Feb 19, 2021

This PR modularizes the regex backend and adds support for fancy-regex. Fixes #18. The solution is very similar to trishume/syntect#270 with an abstraction on top of fancy-regex and onig-rs plus feature flags to switch between them. To do:

  • Add a regex-test-all feature flag which enables both backends at the same time and asserts they do the same thing (needed for tests and building the binaries).
  • Some doc improvements e. g. module level docs in regex.rs.

@bminixhofer bminixhofer marked this pull request as ready for review February 21, 2021 08:18
@bminixhofer bminixhofer merged commit 2ccff5d into main Feb 21, 2021
@bminixhofer bminixhofer deleted the fancy-regex-revive branch February 21, 2021 13:38
drahnr pushed a commit to drahnr/nlprule that referenced this pull request Apr 7, 2021
* modularize regex backend

* add fancy-regex backend, improve from_java_regex function

* fix srx version

* add regex-all backend for testing

* use regex-syntax to convert from java regexes

* support for ignore case flag

* test regex-fancy and regex-onig backends in ci

* support multiple of the same kind of lookaround in a regex

* ignore replacements which are equal to the text to replace

* disallow nested quantifiers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

switch regex engine from oniguruma to fancy-regex
1 participant