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

The wildcard pattern ?* should be treated the same way as *? #9

Open
melsabagh opened this issue Jun 19, 2022 · 1 comment
Open

The wildcard pattern ?* should be treated the same way as *? #9

melsabagh opened this issue Jun 19, 2022 · 1 comment
Assignees
Labels

Comments

@melsabagh
Copy link

melsabagh commented Jun 19, 2022

In Lexpy, ? means "zero or one character" and * means "zero or more characters". Based on this, why is the pattern ?* considered illegal while *? is allowed? Don't they both have the same semantics here:

*?: zero or more || zero or one -> zero || zero, zero || one, more || zero, more || one -> zero, one, more -> zero or more
?*: zero or one || zero or more -> zero || zero, zero || more, one || zero, one || more -> zero, more, one -> zero or more

The code at _utils.py#L15 already translates *? to *, why isn't this also done for ?*?

result = re.sub('(\*\?)+', '*', result) # Replace consecutive '*?' with a single group '*'

@aosingh aosingh self-assigned this Jun 21, 2022
@aosingh aosingh added the fixed label Aug 30, 2022
@aosingh
Copy link
Owner

aosingh commented Sep 7, 2022

This is fixed in lexpy=1.0.0

pip install lexpy==1.0.0

Please test it and let me know if you have any questions.

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

No branches or pull requests

2 participants