The match_all function
- Posted by dr_can Jan 18, 2022
- 905 views
Inspired by Pete's Rosetta Code triumph, I have been looking at various Euphoria entries. One is entitled: Count occurrences of a sub-string. The Euphoria example was probably written before match_all was added, but if you convert the entry to this:
?match_all("th","the three truths") ?match_all("abab","ababababab")
what answers should you get?
I think 3 and 4, respectively, but match_all yields 3 and 2.
The code in search.e doesn't allow for any form of textual overlap, as in the chosen illustration. If intended then I think the reasons should be explicit, but they are not at present.