Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help findrx (extract numbers)
#1
str a="John 10 Anne 100 Peter 5 Andrew 1525 12"

s[0]="10"
s[1]="100"
s[2]="5"
s[3]="1525"
s[4]="12"

findrx?
#2
Code:
Copy      Help
str s="John 10 Anne 100 Peter 5 Andrew 1525 12"

ARRAY(str) a
if(findrx(s "\d+" 0 4 a))
,int i
,for i 0 a.len
,,out a[0 i]

;findrx with flag 4 finds all matches and creates two-dimensional array.
;First dimension is used for match (index 0) and submatches (not used here).
#3
OK. Thanks


Forum Jump:


Users browsing this thread: 1 Guest(s)