Hex color validation with regex

Php code for validating hex color
PHP Regular Expression Character Definition

To user PHP regular expression with preg_match, preg_replace or other preg_ function, one should understand the characters that are used. Below listed all of the characters that are used in regex. List of Regular Expression Characters ^ // Match the beginning of the line . // Match any character (except newline) $ // Match the […]