On 5/17/07, Harry Kakueki <list.push / gmail.com> wrote:
> On 5/17/07, Jon <exabrial / gmail.com> wrote:
> >
> > Example Strings:
> > =====
> > A=" <orderMsg biz=0>"
> > B=" <orderMsg type=7 size=0>"
> > C=" <orderMsg type=7 size=0 biz=1>"
> > =====
>
> Unless you really want to write one regular expression for it all, you
> could do something like this.
>
> Split on spaces, then on '=' . Then process however you want.
>
> r = B.strip.split(/\s/)
> p r
> r[1..-1].each {|f| p f.split("=")}
>
> Harry
>

Sorry for the double post.
This is a little cleaner and easier, I think.

C.strip.delete("<>").split(/\s/).each {|f| p f.split("=")}

Harry


-- 

A Look into Japanese Ruby List in English
http://www.kakueki.com/