-
Sub-task
-
Resolution: Fixed
-
P4
-
None
-
None
-
b87
-
Verified
Currently the regular expression \c control letter escape supports some characters it should not support and doesn't support some characters it should (although the latter is not required by ECMA).
The characters that should not be supported are caused by toUpperCase converting Unicode to ASCII characters:
/\cı/.test("\x09")
=> should return false instead of true
/\cſ/.test("\x13")
=> should return false instead of true
The characters that are supported by other engines are '0'-'9' and '_':
/[\c0]/.test("\x10")
=> should return true instead of false
/[\c_]/.test("\x1F")
=> should return true instead of false
Invalid control letter should be escaped to \\c#:
/[\c#]/.test("\\")
=> should return true instead of false
The characters that should not be supported are caused by toUpperCase converting Unicode to ASCII characters:
/\cı/.test("\x09")
=> should return false instead of true
/\cſ/.test("\x13")
=> should return false instead of true
The characters that are supported by other engines are '0'-'9' and '_':
/[\c0]/.test("\x10")
=> should return true instead of false
/[\c_]/.test("\x1F")
=> should return true instead of false
Invalid control letter should be escaped to \\c#:
/[\c#]/.test("\\")
=> should return true instead of false