[jdev] ruby xmppd, and Psi

Norman Rasmussen norman at rasmussen.co.za
Thu Sep 18 10:03:02 CDT 2008


oh, it might want the global flag:
resp.match(/(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))/g)

On Thu, Sep 18, 2008 at 4:58 PM, Eric Will <rakaur at malkier.net> wrote:

> On Thu, Sep 18, 2008 at 10:56 AM, Norman Rasmussen
> <norman at rasmussen.co.za> wrote:
> > (IANARC - I am not a ruby coder), here's another attempt:
> >    resp = Base64.decode64(elem.text)
> >    resp = resp.match(/(\w+\s*=\s*(?:(?:"[^"]+")|(?:[^,]+)))/)
> >    response = {}
> >    resp.captures do |kv|
> >        k, v = kv.split('=',2)
> >        v.gsub!(/^"(.*)"$/, '\1')
> >
> >        response[k] = v
> >
> >    end
>
> On Thu, Sep 18, 2008 at 10:45 AM, Norman Rasmussen
> <norman at rasmussen.co.za> wrote:
> > fixed:
>
> I'm not sure how to use your re; when I match it the only capture I
> get is "charset=utf8." Do you continue to loop over it, or something?
> _______________________________________________
> JDev mailing list
> FAQ: http://www.jabber.org/discussion-lists/jdev-faq
> Forum: http://www.jabberforum.org/forumdisplay.php?f=20
> Info: http://mail.jabber.org/mailman/listinfo/jdev
> Unsubscribe: JDev-unsubscribe at jabber.org
> _______________________________________________
>



-- 
- Norman Rasmussen
- Email: norman at rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20080918/9f2a2d44/attachment-0002.htm>


More information about the JDev mailing list