Project

Profile

Help

Bug #4634

closed

In regular expressions, \W matches 'a'

Added by Michael Kay over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Regular Expressions
Sprint/Milestone:
-
Start date:
2020-07-07
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Reported here: https://saxonica.plan.io/boards/5/topics/7953

In regular expressions, matches('a', '\W') wrongly returns true.

The problem doesn't apply to 'b' or 'A', and matches('a', '\w') correctly returns true.

Conjecture: there's an out-by-one bug in the way we construct the list of ranges from the data in categories.json. The data for \W is constructed by taking the union of a set of ranges for the character classes comprising \w, then sorting them and forming the complementary ranges.

Please register to edit this issue

Also available in: Atom PDF Tracking page