Bug 20266
| Summary: | RegExp \s does not match NBSP | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kenny Chan <kennytm> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Minor | CC: | ap, zwarich |
| Priority: | P4 | Keywords: | HasReduction, InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.5 | ||
Kenny Chan
The \s pattern in regular expression does not match the non-breaking space character (U+00A0).
According to the ECMA-262 standard (7.2 Whitespace & 15.10.2.12 CharacterClassEscape) the NBSP should be accepted as a member of \s class.
Step to reproduce:
Run the script /\s/.test("\u00A0");
Expected result:
return true
Actual result:
return false
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
<rdar://problem/6121990>
Alexey Proskuryakov
I do not know if this is intentional, but we match IE here.
Cameron Zwarich (cpst)
This was fixed by the introduction of WREC on 32-bit x86 (or at least Mac and Windows), and by r36612 on other platforms.