You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often when I use the Regex filter, I'm not interested in capturing the matching groups as a list; I just want to verify that the incoming string matches the regular expression, and then continue applying filters to the original string.
Add a groups argument to Regex that can be set to any of the following:
True (default, for bc): Filter returns all of the matching groups as a list (this is the current behaviour).
False: Filter returns the input string.
Iterable[int]: Filter returns a list containing only the specified groups.
int (maybe): Filter returns just that group.
That last one feels a bit off, both semantically and functionally. But, it could be useful, so I'll float the idea anyway.
Often when I use the
Regex
filter, I'm not interested in capturing the matching groups as a list; I just want to verify that the incoming string matches the regular expression, and then continue applying filters to the original string.Add a
groups
argument toRegex
that can be set to any of the following:True
(default, for bc): Filter returns all of the matching groups as a list (this is the current behaviour).False
: Filter returns the input string.Iterable[int]
: Filter returns a list containing only the specified groups.int
(maybe): Filter returns just that group.That last one feels a bit off, both semantically and functionally. But, it could be useful, so I'll float the idea anyway.
Examples:
The text was updated successfully, but these errors were encountered: