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

Allow to provide test cases that must not be matched #16

Open
pemistahl opened this issue Feb 16, 2020 · 2 comments · Fixed by #26
Open

Allow to provide test cases that must not be matched #16

pemistahl opened this issue Feb 16, 2020 · 2 comments · Fixed by #26

Comments

@pemistahl
Copy link
Owner

Currently, only test cases that must be matched by the generated regular expression can be provided. It would be useful to additionally provide test cases that must not be matched by the generated expression. In combination with shorthand character classes this would allow for more specific and versatile regular expressions.

@pemistahl pemistahl added the enhancement New feature or request label Feb 16, 2020
@pemistahl pemistahl added this to the grex 1.2.0 milestone Feb 16, 2020
@pemistahl pemistahl modified the milestones: grex 1.2.0, grex 1.3.0 Dec 16, 2020
@pemistahl pemistahl added new feature and removed enhancement New feature or request labels Jan 2, 2021
@pemistahl pemistahl removed this from the grex 1.3.0 milestone Jul 8, 2021
@crispamares
Copy link

First I want to say thank you for this wonderful library, super interesting.

Shomehow realted to this... how feasible would be to provide "matching text + context" so the regex can generalize?

Imagine a user has a collection of texts like this, one line is one different text:

[one, two, three]
[blue, brown]
[car, house]
[ball, cat]
...

I would like to make a toy UI where the user can select with the mouse just "one" and "blue" so the system could return:

one
blue
car
ball
...

That would be possible if grex could generate a regex like this: \[(\w+),. Obviously grex needs to be provided with more than just matching examples but also context that is useful for the regex but not for the user.

@pemistahl
Copy link
Owner Author

Thanks for your idea @crispamares. There is actually a lot of potential in a tool like this. I don't know yet what to implement for the next version but I will keep your suggestion in mind.

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

Successfully merging a pull request may close this issue.

2 participants