Skip to content
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

Support for v (unicodeSets) and d (hasIndices) flags #508

Open
lionel-rowe opened this issue Oct 29, 2023 · 3 comments
Open

Support for v (unicodeSets) and d (hasIndices) flags #508

lionel-rowe opened this issue Oct 29, 2023 · 3 comments

Comments

@lionel-rowe
Copy link

  • v flag (unicodeSets)

    RegExp.prototype.unicodeSets has the value true if the v flag was used; otherwise, false. The v flag is an "upgrade" to the u flag that enables more Unicode-related features. ("v" is the next letter after "u" in the alphabet.) Because u and v interpret the same regex in incompatible ways, using both flags results in a SyntaxError.

    Browser support: widespread in evergreen browsers, latest NodeJS, Deno

  • d flag (hasIndices)

    RegExp.prototype.hasIndices has the value true if the d flag was used; otherwise, false. The d flag indicates that the result of a regular expression match should contain the start and end indices of the substrings of each capture group. It does not change the regex's interpretation or matching behavior in any way, but only provides additional information in the matching result.

    Browser support: universal in evergreen browsers, NodeJS LTS, Deno

@Unique-Pixels
Copy link

Came here to make an issue on this. +1

Note that the v flag is used by the browsers when compiling the pattern attribute on forms, so it is really a needed flag.

@Ivokato
Copy link

Ivokato commented Mar 29, 2024

Just ran into this while fixing our signup flow. It would have been good to debug our outdated email validation pattern so +1

@lionel-rowe
Copy link
Author

@gskinner @wdamien if someone hypothetically were to make a PR adding v flag support, what are the chances of it getting merged and deployed in the near future?

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

3 participants