Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] regex makes no sense. example doesn't work
#2
Macro Macro1
Code:
Copy      Help
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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)