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