Skip to content

Modifier with disabled i flag doesn't match correctlyΒ #2523

@hugo9655

Description

@hugo9655

Bug Description

With the following regex, the contained group sometimes fails to match case-sensitive:
Image

If you tinker with it for long enough, or type out the match differently, sometimes it will work:
Image

This behaviour is wildly inconsistent, but can be replicated with minimal attempts.

Reproduction steps

Find the exact pattern here: https://regex101.com/r/3iZcI2/1

See that its incorrectly matching from the start. Type out the match in different ways, maybe from start to finish, or deleting and re-typing an individual letter, and you should see the inconsistent matching happen as ive described.

Expected Outcome

Consistently match the target string case-sensitive.

Browser

Tested on latest Firefox and Brave (chromium)

OS

Windows 10

Notes:

Ignore the other redundant parts of the regex, those are needed for my specific use-case, including the global case-insensitive flag. Im just reporting the bug thats being caused by the Modifier capture group.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions