$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Cory Nelson (phrosty_at_[hidden])
Date: 2005-09-25 21:09:49
I'm attempting to learn xpressive by writing a simple IRC regex.
The IRC protocol goes like:
:prefix numericreplyorcommandstring param1 param2 :trailing param
The regex looks like this (ignore comments and newlines):
^
(?::(\S+)\s)? // prefix
(?:(\d+)|(\S+)) // command
(?:\s([^:]\S*))* // parameters
(?:\s:(.+))? // trailing parameter
$
And my static xpressive looks like this:
bos >>
optional(':' >> (s1=+~_s) >> _s) >> // prefix
((s2=+_d)|(s3=+~_s)) >> // command
*(_s >> (s4 = ~as_xpr(':') >> *~_s)) >> // parameters
optional(_s >> ':' >> (s5=+_)) >> // trailing parameter
eos
I'm not sure how to retrieve the multiple matches for s4 - any help?
-- Cory Nelson http://www.int64.org