logo CodeStepByStep logo


Language/Type: General regular expressions
Author: Melissa Hovik (on 2018/06/01)

Write a regular expression that will match each of the following patterns:

A hexidecimal color code (a string starting with # followed by exactly 6 numbers or letters 0-9 and A-F (ignore letter-casing)
An rgb color code in the format "rgb(R, G, B)" where R, G, and B are each any integer value between 0 and 255.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.