-
Notifications
You must be signed in to change notification settings - Fork 4
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
Feature Suggestion: Add union / intersect / subset operators to the Regex Classes #17
Comments
Ooooh that's an interesting feature! I think it's definitely possible. We can define custom dunder methods like |
Let's first focus on the My suggestion is that we can build up rules for those regex pairs that can intuitively merged together and simply return For the cases you mentioned about:
Of course, we need to specify the behavior between all the classes. It can be hard to elaborate, but let me try to explain my first idea. We can first categorize the regex classes into char-level classes such as For the char-level classes, we can do the A | B = C operation in the following steps:
For the compositional regex,
For Currently, I have no idea for the advance classes that inherent |
Sounds good. I'll review your PR when you're finished. I'll also add set operations for the advanced classes too before that. 👍 |
Hi @GrandMoff100 ,
I would like to suggest a new feature for this package.
Since a regex is a union of multiple patterns, it can be considered a
set
. How about building union (or) / intersect (and) / is subset of (in) operators to each regex classes?For example:
I am trying to build a regex inference engine. This feature will be beneficial for organizing the regex(es) when the size of the regex object list is large.
I wonder if it's possible to add this feature? I am willing to make this contribute.
The text was updated successfully, but these errors were encountered: