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

Add 'u' flag to be consistent with "pattern" attribute of <input> element #1388

Closed
OpportunityLiu opened this issue Apr 19, 2021 · 2 comments · Fixed by #1427
Closed

Add 'u' flag to be consistent with "pattern" attribute of <input> element #1388

OpportunityLiu opened this issue Apr 19, 2021 · 2 comments · Fixed by #1427

Comments

@OpportunityLiu
Copy link
Contributor

const regex = new RegExp(this.pattern);

see: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern

@Westbrook
Copy link
Contributor

Thanks for the issue. Can you confirm that I'm reading this as an <input> element will also ways interpret its pattern attribute as a regex with the u flag?

If so, would you be interested in submitting a PR for this? In particular, adding a test to this fact, so we don't regress in the future, would be much appreciated!

@OpportunityLiu
Copy link
Contributor Author

I've tested on the latest Chrome & FireFox, seems that the <input pattern> will allow \p{} patterns, as the MDN said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants