From: Robert Klemme Date: 2009-02-08T21:44:08+09:00 Subject: Re: cannot remove multiple space> nuts! On 07.02.2009 22:48, Tom Cloyd wrote: > I have to say that regex's > becoming rather fun, now that I'm getting a little control of it. If you like to dig deeper into the matter, I can recommend http://oreilly.com/catalog/9780596528126/index.html I covers functionality, different regexp dialects and performance considerations thoroughly. Might be a bit difficult to read if you do not have a full CS background but IMHO Jeff Friedl manages to keep language theory at a minimum without scarifying precision. And one more particular Ruby hint: method String#[] is capable of working with regular expression arguments, so you can do # fetch the whole match ip = input[/\d{1,3}(\.\d{1,3}){3}/] # fetch group 1 name = input[/name=(\S+)/, 1] Cheers robert