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

Match Regex fails when '?' is present in the regex expression #1533

Closed
aleruz opened this issue Mar 22, 2021 · 2 comments
Closed

Match Regex fails when '?' is present in the regex expression #1533

aleruz opened this issue Mar 22, 2021 · 2 comments
Assignees

Comments

@aleruz
Copy link
Contributor

aleruz commented Mar 22, 2021

https://github.com/aleruz/karate-call-single-bug/blob/main/src/test/java/examples/regexp/regexp.feature

mvn test "-Dkarate.options=--tags @regex"

The regex parsing fails when the ? is present in the regex. Considering that this is a very frequently used quantifier, this error can be quite frequent.

# org.opentest4j.AssertionFailedError:
# Unexpected internal error near index 14
# /\w{2}/search\

After debugging, found the issue in the MatchOperation class.
I fixed the bug and run the tests locally successfully, and therefore will submit a PR.

aleruz pushed a commit to aleruz/karate that referenced this issue Mar 22, 2021
@ptrthomas ptrthomas added the bug label Mar 23, 2021
@ptrthomas ptrthomas added this to the 1.0.1 milestone Mar 23, 2021
ptrthomas added a commit that referenced this issue Mar 23, 2021
#1533 add a condition to avoid removal of '?' in regex validation
@ptrthomas
Copy link
Member

@aleruz thanks for this ! merged 👍

@ptrthomas
Copy link
Member

1.0.1 released

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

No branches or pull requests

2 participants