lexpy icon indicating copy to clipboard operation
lexpy copied to clipboard

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

Open melsabagh opened this issue 3 years ago • 1 comments

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 ?*?

https://github.com/aosingh/lexpy/blob/b69e0297fc94fe51ea897d311f50230497eb6b93/lexpy/_utils.py#L51

melsabagh avatar Jun 19 '22 14:06 melsabagh

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.

aosingh avatar Sep 07 '22 07:09 aosingh