Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find qm-items using regexp
#1
I am in need to write a macro to find qm-items using regexp, something analogous to using QM-editor find function. If I understand well, qmitem does not work with regexp. I wonder whether there exists another way to overcome it. I attach my workaround.

Function tempf12
Code:
Copy      Help
str sl
QMITEM q; int i
rep
,i=qmitem(-i 1 &q 1)
,if(i=0) break
;,out "%-30s %-30s %s" q.name
,sl.formata("%s[]" q.name)

str pattern="\Qtemp\E\d\d"
ARRAY(str) a
if(findrx(sl pattern 0 4 a)<0) out "does not match"; ret
for i 0 a.len
,out a[0 i]

Many thanks in advance for any advice.


Forum Jump:


Users browsing this thread: 1 Guest(s)