Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splitting a complex string
#4
Learn regular expressions. It will save you lots of time, and not only while working with QM. In most programs where can be used regular expression (eg to find text), regular expression syntax is identical or similar to QM.

Code:
Copy      Help
str s=
;<?xml version="1.0" encoding="iso-8859-1"?>
;<response alpha="18803b54-6c1d-4d4f-aabf-be0da9490c2d" beta="9bd46a13-f717-4665-b0d9-699d42528191" url="GenShield.aspx?ShieldId=9bd46a13-f717-4665-b0d9-699d42528191" />


ARRAY(str) a
if(findrx(s "<response alpha=''(.+?)'' beta=''(.+?)'' url=''(.+?)''" 0 0 a)<0) end "error"
out a[1]
out a[2]
out a[3]


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)