From: Stefano Crocco Date: 2010-01-11T22:03:07+09:00 Subject: Re: Regex help On Monday 11 January 2010, Robert Klemme wrote: > |> You could do this with a regexp which matches the following: > |> * the beginning of the string > |> * four characters of type a-f or digits > |> * a comma > |> * four characters of type a-f or digits > |> * the end of the string > |> > |> The regexp is: > |> /^[a-f\d]{4},[a-f\d]{4}$/ > |> > |> Note that your string can contain newlines, you must replace ^ and $ > |> with \A and \Z respectively. > | > |I believe this should rather be \z because \Z allows for a follwing > |newline. So that would be > | > |/\A[a-f\d]{4},[a-f\d]{4}\z/ You're right. Stefano