Forum Discussion
hooleylist
Jul 08, 2010Cirrostratus
If there are arbitrary numbers of fields in between the ^'s, most string/scan operations wouldn't work. Is there a pattern that you want to parse the two fields between the carets after Virtual^?
getfield would work to split the string on the string ;virtual^. You could then break up the last half on the ^. Here's an untested snippet:
set tmp [getfield [HTTP::header route] {;virtual^} 2]
log local0. "Parsed [HTTP::header route] to $tmp"
scan $tmp {^%[^^]^%[^^]} a b
log local0. "Parsed $tmp to $a and $b"
If that works, you can skip the intermediate variable:
scan [getfield [HTTP::header route] {;virtual^} 2] {^%[^^]^%[^^]} a b
log local0. "Parsed [HTTP::header route] to $a and $b"
Aaron