-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
unicorn/better-regex
autofix breaks "match all" in multiline regexps
#895
Comments
While this is definitely a bug, your proposed expected fix is incorrect. In JS RegExp, the dot ( - /lorem(?:.|\n)*?ipsum/m
+ /lorem[^\r\u2028\u2029]*?ipsum/m (Whether this fix is desirable is a different question.) |
This should be reported at https://github.com/DmitrySoshnikov/regexp-tree, which is what does the regex transformations. If you can figure out which transform that causes this, it might be possible to disable that specific transform in the mean time:
|
I've opened an upstream issue: DmitrySoshnikov/regexp-tree#217 |
This regexp is autofixed by
unicorn/better-regex
like this:This breaks the regex:
(.|\n)
means "any character, including a newline character"[.\n]
means "a period character or a newline character"Instead, it should be fixed to
[^]
, according to https://stackoverflow.com/a/16119722/451391:The text was updated successfully, but these errors were encountered: