Below is the code in which regex is used for looking for colors in the HTML format (e.g., #ABCDEF: the # sign and 6 hexadecimal characters) in the input string.
Find all matches with colorRegex in the input text and output all found colors, each on a new line.
Input: text: String
Output: found HEX color codes printed as Strings, each on a new line.
Tip: Remember about null safety.