Re: new feature req

new topic     » goto parent     » topic index » view thread      » older message » newer message
Kat said...

Right now, find_any() and match_any() stop on the first hit. Maybe if the 3rd pram of the existing function names are set to zero, all hits are returned, not just the first.

There is currently a find_each() function, which returns a list of hits. Would that suit your purpose?

I've not really looked at these related functions before and I'm now seeing that the one called match_any is both poorly named and redundant, in my opinion. I think that any of these search functions that have 'find' in their name, should have the semantics of the built-in find function, namely that they look for single elements in the 'haystack' and that functions with match in their name should be looking for sub-sequences in the 'haystack'.

The current match_any should better be named something like is_any_in() or does_contain_any(), because it returns a TRUE/FALSE value rather than an index. As it is currently named, I assumed it would be searching to see if one of the set of sub-sequences ('needles') was in the 'haystack' and if so, return its position in the 'haystack'.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu