The match_all function

new topic     » topic index » view thread      » older message » newer message

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.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu