1. new feature req
- Posted by useless_ Feb 16, 2013
- 1234 views
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.
useless
2. Re: new feature req
- Posted by DerekParnell (admin) Feb 17, 2013
- 1199 views
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'.
3. Re: new feature req
- Posted by useless_ Feb 17, 2013
- 1219 views
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?
Hmm, find_each() and match_each() use the same inputs. Match_each() returns only 1 value, according to the docs?
I just ran find_each() and it does what i was looking for. Thanks, Derek.
useless