Skip to content

Optimization breaks "match all" in multiline regexps #217

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

Open
FloEdelmann opened this issue Jan 12, 2021 · 1 comment
Open

Optimization breaks "match all" in multiline regexps #217

FloEdelmann opened this issue Jan 12, 2021 · 1 comment

Comments

@FloEdelmann
Copy link

This regexp is optimized like this:

- /lorem(?:.|\n)*?ipsum/m
+ /lorem[.\n]*?ipsum/m

This breaks the regex:

  • (.|\n) means "any character, including a newline character"
  • [.\n] means "a period character or a newline character"

See sindresorhus/eslint-plugin-unicorn#895.

@DmitrySoshnikov
Copy link
Owner

Thanks, I'll take a look. Also will appreciate a PR if you reach it earlier.

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

No branches or pull requests

2 participants