Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY and findrx?
#5
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
Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)