Untitled

mail@pastecode.io avatar
unknown
python
a year ago
739 B
3
Indexable
Never
regex_entries = [
                ["REGEX", '<span style="background-color: #2a9d8f; color:#FFFFFF;">%s</span>'], 
                ["RED", '<span style="color: #FF0000;">%s</span>'],
                ["GREEN", '<span style="color: #00FF00;">%s</span>'],
                ["BLUE", '<span style="color: #0000FF;">%s</span>'],
                [">>>", '<span style="color: #E85951; font-family: cursive; font-size: 10px; font-weight = 1000">%s</span>'],
                ["<<<", '<span style="color: #2FC6B4; font-family: cursive; font-size: 10px; font-weight = 1000">%s</span>'],
]


def print_format(string, mode):
    for regex in regex_entries:
        string = re.sub(regex[0], regex[1] % regex[0], string)
        print(string)