From 5026751c4185f8447b1b43a977a5335382a3d1f1 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 5 Jun 2013 20:08:00 +0200 Subject: [PATCH] Add debug mode for re.compile --- colout/colout.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/colout/colout.py b/colout/colout.py index 59fffa8..9bf991c 100755 --- a/colout/colout.py +++ b/colout/colout.py @@ -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' """ 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. colored_text = ""