Bug 10611 - Test of regular expression always yields false
Summary: Test of regular expression always yields false
Status: RESOLVED DUPLICATE of bug 7253
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks:
 
Reported: 2006-08-28 15:23 PDT by Mark Malone
Modified: 2015-08-14 13:53 PDT (History)
1 user (show)

See Also:


Attachments
Test Case (860 bytes, text/html)
2006-08-28 15:24 PDT, Mark Malone
no flags Details
Test Case (869 bytes, text/html)
2006-08-28 15:32 PDT, Mark Malone
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Malone 2006-08-28 15:23:11 PDT
Given:
function isRestrictedText(s)
{
      var filter = /^[\w!#$,;=@_`~\-\^\'\.\{\}\[\]\(\)\u00C0-\uFFFF]( ?[\w!#$,;=@_`~\-\^\'\.\{\}\[\]\(\)\u00C0-\uFFFF])*$/;
     alert(filter.test(s));
}

Legal and non-legal input values alert false.
Comment 1 Mark Malone 2006-08-28 15:24:22 PDT
Created attachment 10287 [details]
Test Case
Comment 2 Mark Malone 2006-08-28 15:25:00 PDT
rdar://4694011
Comment 3 Mark Malone 2006-08-28 15:32:32 PDT
Created attachment 10288 [details]
Test Case

Attached Test Case
Comment 4 Alexey Proskuryakov 2006-08-28 21:50:09 PDT
Workaround:

var filter = new RegExp("^[\\w!#$,;=@_`~\\-\\^\\'\\.\\{\\}\[\\]\\(\\)\u00C0-\uFFFF]( ?[\\w!#$,;=@_`~\\-\\^\\'\\.\\{\\}\\[\\]\\(\\)\u00C0-\uFFFF])*$");

*** This bug has been marked as a duplicate of 7253 ***