02-09-2014, 01:37 PM
Macro Macro1
I think this can get you started.
str subject="<!--987987-->"
ARRAY(str) result
str regx="<!--(.*)-->"
if(findrx(subject regx 0 0 result)>=0)
,out F"result: {result[1]}" ;; output '987987'
;; ARRAY(str) result receives the match in element 0
;; and submatches in subsequent elements.
;; this means 'result[0]' will contain: '<!--987987-->'
;; everything above '0' will contain the submatches, this means:
;; 'result[1]' will contain '987987'
;; A submatch is the part of the match that matches a captured subpattern.
;; A captured subpattern is the part of pattern that is enclosed
;; in parentheses and does not begin with ?.
I think this can get you started.