We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The unicode flag was recently added:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode
It should be used by default!
/^.$/.test('a') //✅ /^.$/.test('🐶') //❌ /^.$/u.test('🐶') //✅
By default, . matches any character except for line terminators:
/foo.bar/u.test('foo\nbar'); // → false (It doesn’t match astral Unicode symbols either, but we fixed that by enabling the u flag.)
ES2018 introduces dotAll mode, enabled through the s flag. In dotAll mode, . matches line terminators as well.
/foo.bar/su.test('foo\nbar'); // → true
__
both flags can be used as the new standard
Reference:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Unicode Flag (u)
The unicode flag was recently added:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode
It should be used by default!
dot all flag (s)
By default, . matches any character except for line terminators:
ES2018 introduces dotAll mode, enabled through the s flag. In dotAll mode, . matches line terminators as well.
__
both flags can be used as the new standard
Reference:
The text was updated successfully, but these errors were encountered: