Darwin Help

Back to Index

SearchMultipleString

Function SearchMultipleString - search several sequential patterns in a string

Calling Sequence  SearchMultipleString(pat1,pat2,...,text)
Parameters
NameTypeDescription

pat_i string 
txt string 
Return Type  list(integer)
Synopsis The SearchMultipleString function returns a list with the offsets of all the matches of each of the patterns given as arguments. This is very useful when one wants to search for a portion of a string enclosed in some particular context. The individual patterns are matched as case insensitive. All the patterns have to match, in a non-overlapping way and in the given order. If there is no match of all the patterns, the function returns an empty list.
Examples
> SearchMultipleString( '(', 'a', ')', '(),(bbb), (...a...)' );
[0, 14, 18]
See also ApproxSearchString,   CaseSearchString,   HammingSearchString,   SearchDelim,   SearchString