07-20-2011, 03:26 PM
it is in findrx
str s
s.getrx(...)
|
v
findrx(... s) ;;here s also can be int (length) and ARRAY (all submatches as strings or offsets)
Member function str.getrx
str s
s.getrx(...)
|
v
findrx(... s) ;;here s also can be int (length) and ARRAY (all submatches as strings or offsets)
Member function str.getrx
function# $s $rx [flags] [submatch] [from_] ;;flags: 1 insens., 2 whole word, 8 multiline, 16 no submatches, 32 ANSI, pcre flags.
;Gets substring that matches regular expression.
;REMARKS
;Same as <help>findrx</help>, but called differently.
;EXAMPLE
;str string substring
;string="one 22 three"
;if(substring.getrx(string "\d+" 2)<0) end "not found"
;out substring
ret findrx(s rx from_ flags this submatch)
err+ end _error