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

Add fancy_regex support #8

Merged

Conversation

stevefan1999-personal
Copy link
Contributor

Fixes #3

@igordejanovic
Copy link
Owner

Looks good. Thanks. Would you be able to add a test for this feature?

@igordejanovic igordejanovic merged commit 1358f20 into igordejanovic:main Feb 17, 2024
5 of 6 checks passed
@stevefan1999-personal
Copy link
Contributor Author

Looks good. Thanks. Would you be able to add a test for this feature?

Oh I think it is out of the box compatible with the original regex so it is not that needed.

I have literally used the fancy-regex's main page example to parse Rust raw string: r(#*)".*?"\2. There is a slight change because the regex itself is wrapped in a main capture group, so it ended up being (r(#*)".*?"\1) internally in the generated lexer, which is obviously incorrect and so I fixed the capture cardinal to 2,

@igordejanovic
Copy link
Owner

igordejanovic commented Feb 18, 2024

I've made a little test nevertheless just to be sure that it keep working as intended. I've stumbled across the same problem with capture groups so I removed wrapping in outer parentheses which should now work most of the time except for situation like a|b which should be written as (a|b) or a|^b (this should be noted somewhere in lexer docs probably). I also added fancy regex config to CLI.

@igordejanovic igordejanovic mentioned this pull request Mar 10, 2024
igordejanovic added a commit that referenced this pull request Mar 10, 2024
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.

use fancy-regex instead of regex?
2 participants