From: Robert Klemme Date: 2009-01-27T22:48:52+09:00 Subject: Re: Name Extraction 2009/1/27 Newb Newb : > Hi Friends > > i have following string > > jayabharathy@angleritech.com~Vs~kannan@angleritech.com > > the above string has 2 email ids in it.but i need only names of it. > > i want to extract only the names > > jayabharathy > > kannan Something like this can work, depends of course on the names that you want to allow: names = str.scan(/(\w+)@[a-z._-]+/i).flatten Cheers robert -- remember.guy do |as, often| as.you_can - without end