|
RegularExpressionParse
array RegularExpressionParse(string
regexp, string string)
Return
Value
Returns array of strings. If input string does not match provided
pattern the size of result array is 0.
Parameters
regexp–pattern
string containing regular espression.
string
– string that needs to be compared
with regexp.
Remarks
This function parses a
regular expression and converts an input string into array of
tokens if string matches regular expression. See RegularExpressionMatch
article for
more information about regular expression syntax and
abbreviations.
Example
The following
example demonstrates the use of
RegularExpressionParse.
# Example for RegularExpressionParse
string regexp = "({[^:/?#]+}:)?(//{[^/?#]*})?{[^?#]*}(?{[^#]*})?(#{.*})?"
string url = "http://search.microsoft.com/us/Search.asp?qu=atl&boolean=ALL#results"
array data
data =
RegularExpressionParse(regexp, url)
int nSize = GetArraySize(data)
for(int
i=0; i<nSize; i++)
Println(data[i])
endfor
Output of the example
script:
http
search.microsoft.com
/us/Search.asp
qu=atl&boolean=ALL
results
|