Hey Chris,

        Thanks for giving it a shot. Apologies for not getting back to folks
yesterday but I sent the mail as I was leaving work. 
It works perfectly and to be honest it is the way I would have gone about
it myself if I was more familiar with the API.

Thanks again,
Mark.

-----Original Message-----
From: Chris McMahon [mailto:[EMAIL PROTECTED]
Sent: 27 October 2005 19:03
To: [email protected]
Subject: Re: [Wtr-general] My regexp is too greedy!!


> The following ruby expression
> / (.*local.xml?)/.match('xpl.xml, demoUK.xml, met_local.xml, cfg.xml')[1]
> returns
> => "demoUK.xml, met_local.xml"

I'll take a crack-- how about

#############################################3
string = 'xpl.xml, demoUK.xml, met_local.xml, cfg.xml'

files = string.split(', ') #comma space

files.each {|x|
puts x if x=~ /local.xml/
}
#####################################

Does that help?
-Chris

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to