Syntax
int search( list X, string pattern)
Description
The search function returns the index of the first matching instance of pattern in the specified list. If there is no match, it returns -1.
The first element in the list is index:0.
Example
The following example prints the index number for "cory", which is 1:
a=search({"jamie","cory","robyn"},"c*"); print(a);
j* |
j followed by any number of characters. |
j*e |
j followed by any number of characters, ending with an e. |
[jJ]* |
Upper or lower case j followed by any number of characters. |
[a-z] |
Any lower case character. |
[^a-z] |
Any character except lower case characters. |
j followed by a single character. |