Sandeep Gudibanda
2007-Sep-05 20:30 UTC
Splitting @xyz from email id: username-+zpghU0kKgY@public.gmane.org
Hi, Can someone please explain how to strip username from username-+zpghU0kKgY@public.gmane.org? Regards, Sandeep G -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Adam Cohen
2007-Sep-05 20:44 UTC
Re: Splitting @xyz from email id: username-+zpghU0kKgY@public.gmane.org
On 9/5/07, Sandeep Gudibanda <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > > Can someone please explain how to strip username from username-+zpghU0kKgY@public.gmane.org?here''s a quick and dirty regex, might need to be improved ''user.name-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org'' =~ /(\S*)@/ the resulting ''user.name'' value will be stored in $1 Adam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Butch Anton
2007-Sep-06 06:41 UTC
Re: Splitting @xyz from email id: username-+zpghU0kKgY@public.gmane.org
Sandeep Gudibanda wrote:> Hi, > > Can someone please explain how to strip username from username-+zpghU0kKgY@public.gmane.org? > > Regards, > Sandeep G> "foo-+RB1Aph5k6s@public.gmane.org".split("@")[0]=> "foo" Butch -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sandeep Gudibanda
2007-Sep-07 05:39 UTC
Re: Splitting @xyz from email id: username-+zpghU0kKgY@public.gmane.org
Butch Anton wrote:> Sandeep Gudibanda wrote: >> Hi, >> >> Can someone please explain how to strip username from username-+zpghU0kKgY@public.gmane.org? >> >> Regards, >> Sandeep G > >> "foo-+RB1Aph5k6s@public.gmane.org".split("@")[0] > => "foo" > > ButchThanks Butch, this is clean too! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---