From: Richard Conroy Date: 2008-12-18T21:01:05+09:00 Subject: Re: Hopefully simple regex On Wed, Dec 17, 2008 at 10:37 PM, stephen O'D wrote: > >> >> Try this: >> >> @regex = /(?:^|\s)(@\w+)/ >> >> David > > Perfect - I didn't know you could (or even think to try) putting the > 'start of string' anchor inside a group with an alternative! At least > I have learned something from the last hour of trying! > http://www.rubular.com is an awesome way of composing and testing ruby regular expressions. Highly recommended.