A Regex (regular Expression) is a snippet of code that is used to extract bits of information from any field of text. It accomplishes this by setting up key parameters to search for within a body of text. A regex is a very powerful tool and can be used in almost all programable languages like JavaScript, Java, VB, Python, and many more!
The regex that we will be looking at in this gist is for hex colors. A hex color is a representation of various colors that follows a specific hexadecimal integer count so it is fairly easy to keep track of. The regex to search for a hex color code will be: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$. Bellow we will break apart the different parts of this regex so that we can better understand what is being shown.