Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fn:matches surprisingly returns false for fn:matches("AB", "^(.*)+B") #59

Open
faassen opened this issue May 15, 2024 · 4 comments
Open

Comments

@faassen
Copy link

faassen commented May 15, 2024

With Saxon, fn:matches("AB", "^(.*)+B") returns false, and I don't understand why. I've ported Saxon's regex engine to Rust, and I'm also getting a false here (once I fixed another bug), which surprised me, so I verified that Saxon does the same.

Looking at it, the .* should consume "A", and then "B" should be matched. But it doesn't do that.

On regex101 all the flavors have it match https://regex101.com/r/JfmqWf/1

I'm trying to understand why it wouldn't match for the XPath regex flavor. And whether it should match or not, I think it's worthwhile adding a test case to the test suite to nail this behavior down.

This behavior is implemented inside of the Repeat op, for greedy matching. I suspect it's in advance() (in the Java code). I see a bug was fixed previously (3787).

@michaelhkay
Copy link
Contributor

We can certainly look at this as a Saxon issue.

For clarity, though, you have raised this as an issue against the W3C test suite. Is there a test in the test suite that you believe to be incorrect?

@michaelhkay
Copy link
Contributor

I've logged a Saxon bug at https://saxonica.plan.io/issues/6426 -- please follow progress there.

@faassen
Copy link
Author

faassen commented May 23, 2024

I think a new test should be added to the test suite, so it's good to track this here too.

@faassen
Copy link
Author

faassen commented May 24, 2024

I'd like to see what fix you applied in Saxon so I can port it to my Rust version, but I think I have to wait for an open source release to see what you changed, correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants