From: Isaac Sanders Date: 2011-10-03T01:07:15+09:00 Subject: Re: Need some help with regexp --20cf305b10e831aaac04ae530d49 Content-Type: text/plain; charset=ISO-8859-1 You are getting that because you have spaces in it. You can get the same result if you use /(\S+)/ and using the $1 variable, which should contain "MARCOCHEN". On Sun, Oct 2, 2011 at 11:46 AM, Eyal Eizenberg wrote: > Hello, I need some help with regex > I have the following expression: "Laptop MARCOCHEN (192.168.5.73)" > I need a regular express to capture only the second word, in this case > "MARCOCHEN". I don't want to use "split" > > So far I am using / \S+ /i > but this is getting also the spaces before and after so what I am > getting is " MARCOCHEN " > > Any advice? > > Thanks a lot! > > -- > Posted via http://www.ruby-forum.com/. > > -- Sincerely, Isaac Sanders Section C-4B Vice Chief, Order of the Arrow Vice Chief of Administration, Tecumseh #65 Eagle Scout --20cf305b10e831aaac04ae530d49--