You are viewing a single comment's thread. Return to all comments →
My solution, matching only within {} sections
import re n = int(input()) css="" for i in range(n): css += input() rsection = r"{.*?}" rhexcode = r"#[0-9A-Fa-f]{6}|#[0-9A-Fa-f]{3}" sections = re.findall(rsection,css) for s in sections: hexcodes = re.findall(rhexcode,s) for hc in hexcodes: print(hc)
Seems like cookies are disabled on this browser, please enable them to open this website
Hex Color Code
You are viewing a single comment's thread. Return to all comments →
My solution, matching only within {} sections