Project

Profile

Help

Bug #3387

closed

Inverse character ranges in regular expressions

Added by Michael Kay over 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath Conformance
Sprint/Milestone:
-
Start date:
2017-08-11
Due date:
% Done:

100%

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

Description

I think the logic for handling inverse character ranges such as \P{L} may be incorrect.

For two-letter categories the logic is sound. The categories.json file gives a definition of Ll as

[["61","7A"],["B5","B5"],["DF","F6"],...

and to invert this we form the ranges corresponding to the gaps:

["0","60"],["7B","B4"],["B6","DE"],...

This only works if the ranges are in ascending order. For single-character categories such as L, we concatenate the subcategories, and the result is therefore the union of the gaps in the subcategories, when it should be the gaps in the union of the subcategories.

Oddly, I can't point my finger at tests that are failing as a result.

Please register to edit this issue

Also available in: Atom PDF Tracking page