Skip to content

Optimization breaks "match all" in multiline regexps  #217

Open
@FloEdelmann

Description

@FloEdelmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions