-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
** behaves like * inside or expression #104
Comments
In my particular case I was merging multiple glob expressions with |
PR would be welcome, as long as it's passing all unit tests. I think there are several thousand from bash, minimatch, etc.
There are opportunities to improve some of the matching with extglobs, since negative and positive lookbehinds were not available when I wrote this parser. My recommendation is that you take the patterns from your examples and show what they should look like if they were pure regular expressions. There are many limitations in ES regular expressions. We can't do atomic groups, we can't do proper conditionals, etc. Which makes it more challenging, but also the longer and more complicated the regex, the more branches we have and the more susceptible to catastrophic backtracking. |
Yep, it's great that there are so many tests, it will really make my life easier if I get into making the changes. As to regex itself, I don't really see how Now I don't know if it is of any interest to you, but I actually wrote the only non-native (i.e. scripted) non-backtracking regex engine currently in the ecosystem: @iter-tools/regex. It's a bit sluggish though as it is scripted and doesn't implement the DFA optimization, which is to say that it may be in more than one state at a time. |
Expected:
pm('(**|x)')('a')
istrue
pm('(**|x)')('a/b')
istrue
Actual:
pm('(**|x)')('a')
istrue
pm('(**|x)')('a/b')
isfalse
Most of the discussion of the technical aspects of this issue is in the now-closed #88.
The text was updated successfully, but these errors were encountered: