I've got a string:
string <- "I do not like green eggs and ham!"
and a pattern
pattern <- "(egs|ham)"
I want to know how many times pattern matches string with fuzzy matching (agrep).
gregexpr will do this for normal matching - I just want to know if there's a corresponding garegexpr in R or a way to emulate it without being too performance-heavy.
(aregexec will only return the index for the first match, "eggs", and skip "ham").