From: Phrogz Date: 2010-01-11T22:45:09+09:00 Subject: Re: Regex help On Jan 11, 5:57 am, Robert Klemme wrote: > > On Monday 11 January 2010, Chris Lervag wrote: > >> |I want to test a string for three properties: > >> |1) It is exactly 9 characters long. > >> |2) Character number 5 is a comma (','). > >> |3) The other characters are either numbers 0-9 or letters a-f. > /\A[a-f\d]{4},[a-f\d]{4}\z/ Slightly more terse: /\A\h{4},\h{4}\z/ ...where \h is a hexadecimal character [0-9a-fA-F] (assuming upper- case a-f is fine).