Add debug mode for re.compile
This commit is contained in:
parent
f082dbc3a2
commit
5026751c41
1 changed files with 5 additions and 1 deletions
|
|
@ -444,7 +444,11 @@ def colorup(text, pattern, color="red", style="normal", on_groups=False):
|
||||||
'\x1b[1;34mF\x1b[0m\x1b[3;34maites\x1b[0m \x1b[1;34mC\x1b[0m\x1b[3;34mhier\x1b[0m la Vache'
|
'\x1b[1;34mF\x1b[0m\x1b[3;34maites\x1b[0m \x1b[1;34mC\x1b[0m\x1b[3;34mhier\x1b[0m la Vache'
|
||||||
"""
|
"""
|
||||||
global colormap_idx
|
global colormap_idx
|
||||||
regex = re.compile(pattern) # , re.IGNORECASE)
|
|
||||||
|
if not debug:
|
||||||
|
regex = re.compile(pattern)
|
||||||
|
else:
|
||||||
|
regex = re.compile(pattern, re.DEBUG)
|
||||||
|
|
||||||
# Prepare the colored text.
|
# Prepare the colored text.
|
||||||
colored_text = ""
|
colored_text = ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue