andrewCodeDev / Fluent

Fluent interface for REGEX, iteration, and algorithm chaining.
MIT License
82 stars 3 forks source link

Remove and reorder regex string before tokenizing #12

Closed andrewCodeDev closed 6 months ago

andrewCodeDev commented 6 months ago

Regex strings need to be reordered and cleaned before being passed to the parser. The are a bit edge-casey, but we should still catch them before heading off to tokenization. Currently, the following regex expressions give invalid results:

"a?a": This needs to become "aa?" to allow the optional to be bypassed.

These two need to be handled differently:

"a+a": This needs to become "a+" to consume the second a.

"a*a": This needs to become "aa*" to consume the second a.

andrewCodeDev commented 6 months ago

fixed optional ordering