Skip to content

return all submatches in RegexMatch instead of the first#787

Closed
rkyleg wants to merge 1 commit intoMontFerret:masterfrom
rkyleg:regex_match_return_all_submatches
Closed

return all submatches in RegexMatch instead of the first#787
rkyleg wants to merge 1 commit intoMontFerret:masterfrom
rkyleg:regex_match_return_all_submatches

Conversation

@rkyleg
Copy link

@rkyleg rkyleg commented Jul 6, 2023

test string: "39.59% annually and 0.04% monthly"

previously regex_match would only return [39.59] for a regex of "\d+[.]\d+" or [39.59,35.59] for a regex of "(\d+[.]\d+)"

this pull request fixes that and returns [39.59,0.04] for a regex of "\d+[.]\d+" and [[39.59,39.59],[0.04,0.04]] for a regex of "(\d+[.]\d+)"

@ziflex
Copy link
Member

ziflex commented Jul 10, 2023

Hey, thanks for the fix!
But, could you write some unit tests, please?

@ziflex ziflex deleted the branch MontFerret:master March 5, 2026 23:09
@ziflex ziflex closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants