Project

Profile

Help

Bug #3787

closed

Regex shouldn't match, but matches

Added by Stefan Pöschel almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2018-05-16
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:
Platforms:

Description

I have a strange issue with an regex that matches - though it shouldn't. The regex is about matching a string that contains a certain amount of tokens, separated by a single space.

I tried to generalize/minimize the issue to the extent that it still occurs. In the example the token is just "x". The part regex that matches such a token could therefore also be "x". The original issue and possible tokens are a bit more complex, so I instead use "(\d*.)?x" to match a token. As neither digits nor full stops are contained in the checked string, the added optional part must not make a diference....but it does, in certain cases.

Please find attached an XSLT file that tries to match different versions of the regex. There are three pairs of regex, whereby always the first one shall not match and the second one shall match. The very first one of the six regexes shall not match as well - but it actually matches.

I checked with Saxon HE 9.8.0.12.

Possibly related/solved by #3782?


Files

regex_test.xslt (2.39 KB) regex_test.xslt Stefan Pöschel, 2018-05-16 08:06

Please register to edit this issue

Also available in: Atom PDF