From: Shashank Agarwal Date: 2008-08-13T10:35:47+09:00 Subject: Re: regular expresson isue Raj Singh wrote: > I have following regular expression to parse time. > > ([0-9]|0[0-9]|1[012]):([0-9]|0[0-9]|[1-5][0-9])\s*(am|pm) > You want to match from the beginning of the string. So put a ^ before your statement - ^([0-9]|0[0-9]|1[012]):([0-9]|0[0-9]|[1-5][0-9])\s*(am|pm) -- Posted via http://www.ruby-forum.com/.