Re: The match_all function
- Posted by petelomax Jan 18, 2022
- 652 views
dr_can said...
Inspired by Pete's Rosetta Code triumph
Glad someone is!
dr_can said...
I think 3 and 4, respectively, but match_all yields 3 and 2.
Well that confused me, until I realised you meant length(). Anyway, FYI, this is what Phix can do:
?match_all("th","the three truths") -- {1,5,14} (length 3) ?match_all("abab","ababababab") -- {1,5} (length 2) ?match_all("abab","ababababab",overlap:=true) -- {1,3,5,7} (length 4)
See here for the Phix version of match_all().