-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
No support for 's' flag #30
Comments
still not sure how to handle this. should ret output a different token for the right now, the latter is the case for the |
I'd argue that ret should handle the flags. Flags are part of the expression. There's no mechanism (in native regex at least) to evaluate an expression with different flags. But you'd have to do something like change I think I'm going to fork
If I do all this work (which would basically amount to a rewrite), would you be interested in merging them under a new major version number or would you prefer that I publish my fork as a separate package? |
If you're interested in my context, I've just finished up the core architecture for my first regex engine: @iter-tools/regex. |
yes! i'd be interesting in merging and working together. i agree on most of those changes, i'll go ahead and comment my thoughts below
yeah... there was recently a PR that changed part of that code. i made a comment that i regret coding it that way
yep, i've made this comment before too
i suppose this could help with debuggig if someone prints the tokens. i don't think this would be breaking either, assuming people are using
👍
don't understand this one
i agree that they should both contain one
if it matches well known, widely used, official specs then yeah 👍 |
If expressions take over for root and group, it is useful to know what index they are. When you have the index you know where they belong in the array returned by match, which backreference they match, etc. This is super useful for engines like mine, which store captures in a sparse immutable linked list, so the index of the captured content in the list doesn't necessarily equate to its capture index. |
The 's' flag should have implications for the behavior of ret, specifically what it outputs for the
.
expression, but it always outputs ranges as ifs
flag were not specified.The text was updated successfully, but these errors were encountered: