in reply to Re: Insert colons into a MAC address
in thread Insert colons into a MAC address

Instead of using the [0-9A-F] character class (more correct would be [0-9a-fA-F] and then you can drop the i parameter) you can use \p{Hex}.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James