Ammar Ali wrote in post #1054416:
> On Sat, Mar 31, 2012 at 9:58 PM, Niels Steves <lists / ruby-forum.com>
> wrote:
>>
>> /\A([0-9a-fA-F]{1,2},{1})*([0-9a-fA-F]{1,2}){1}\Z/
>
> You can use \h to match a hexadecimal digit as well, which match both
> lower and upper case a-f.
>
>   /\A(\h{1,2},)*\h{1,2}\z/

Just a tiny remark: this one should be more efficient

/\A\h{1,2}(?:,\h{1,2})*\z/

because it avoids backtracking of the NFA and does not use a capturing
group.

Kind regards

robert

-- 
Posted via http://www.ruby-forum.com/.