Closed
Description
Test code:
function re_test (pattern, string)
{
var r = new RegExp (pattern);
print ("'" + pattern + "' ~ '" + string + "' => '" + (new RegExp (pattern)).exec(string) + "'");
}
re_test ("[\\u0020]", "u");
re_test ("[\\u0020]", " ");
re_test ("[\\u0020]", "x");
re_test ("[\\x20]", "u");
re_test ("[\\x20]", " ");
re_test ("[\\x20]", "x");
Output:
'[\u0020]' ~ 'u' => 'u'
'[\u0020]' ~ ' ' => ' '
'[\u0020]' ~ 'x' => 'null'
'[\x20]' ~ 'u' => 'null'
'[\x20]' ~ ' ' => ' '
'[\x20]' ~ 'x' => 'x'
The first and last results are incorrect.
This could either be fixed in #961 or handled separately (in which case a regtest could be added to the test suite as well, based on the above).