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
If you want to perform a regex search in a string as with match(), there doesn't seem to be any way to get all matches at once except for awkwardly looping through count values and repeatedly calling match().
We should create a utility function that will take a regex and return all matches, similar to python's re.findall. Each match will have a few properties you might want to know (start, end, capture groups), so it makes sense to return a dict for each, something like:
If you want to perform a regex search in a string as with
match()
, there doesn't seem to be any way to get all matches at once except for awkwardly looping through count values and repeatedly calling match().We should create a utility function that will take a regex and return all matches, similar to python's re.findall. Each match will have a few properties you might want to know (start, end, capture groups), so it makes sense to return a dict for each, something like:
[{'start': 1, 'end': 2, 'groups': []}, {'start': 4, 'end': 4, 'groups': []}, {'start': 7, 'end': 7, 'groups': []}]
The text was updated successfully, but these errors were encountered: