summaryrefslogtreecommitdiff
path: root/cmd2/constants.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-04-27 10:09:21 -0600
committerkotfu <kotfu@kotfu.net>2018-04-27 10:09:21 -0600
commitbed0b6be151b2eafd03111cd3782e2672d193443 (patch)
tree368134105548c83ee224af234081b981be157725 /cmd2/constants.py
parentab74278cc5aa48d62294d648c3813fffe2151937 (diff)
downloadcmd2-git-bed0b6be151b2eafd03111cd3782e2672d193443.tar.gz
Create utils module for utility functions
Diffstat (limited to 'cmd2/constants.py')
-rw-r--r--cmd2/constants.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd2/constants.py b/cmd2/constants.py
index cfdf7624..6784264f 100644
--- a/cmd2/constants.py
+++ b/cmd2/constants.py
@@ -2,6 +2,11 @@
# coding=utf-8
"""Constants and definitions"""
+import re
+
# Used for command parsing, tab completion and word breaks. Do not change.
QUOTES = ['"', "'"]
REDIRECTION_CHARS = ['|', '<', '>']
+
+# Regular expression to match ANSI escape codes
+ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m')