Closed Bug 1377087 Opened 8 years ago Closed 8 years ago

backslash 's' (\s) fails to match non-breacking whitespace (\u00a0) in Firefox ESR 52.2.0 regexp

Categories

(Core :: JavaScript Engine, defect)

52 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sdescarpentries, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Build ID: 20170613225334 Steps to reproduce: I tried to match a regexp against a string containing a \u00a0 (from converted   HTML entity). The regexp was defined using '\s' to match every whitespaces. Actual results: The \u00a0 has not been matched. Expected results: It should have been matched as stated here : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp « \s : Matches a single white space character, including space, tab, form feed, line feed and other Unicode spaces. Equivalent to [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. For example, /\s\w*/ matches " bar" in "foo bar". » I replaced my \s by a [\s\u00a0] and it worked.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Can you provide a standalone testcase? the following code works as expected and it matches: "\xa0".match(/\s/)
Flags: needinfo?(siltaar)
Ok sorry, my bad. I badly escaped my \s.
Flags: needinfo?(siltaar)
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.