php regexp for hexadecimal color codes
This regular expression matches on a hexadecimal color code (like #ffffff). These are often used in style sheets and HTML code
(regexp can ofcourse be used for other languages as well..)
(regexp can ofcourse be used for other languages as well..)
preg_match('/^([0-9a-f]{1,2}){3}$/i', $color);