From d6a8ac3fbbce634aefc031283b01efacbc4eaa0a Mon Sep 17 00:00:00 2001 From: Michal Cihar Date: Tue, 23 Jun 2009 10:09:48 +0000 Subject: [PATCH] Better escaping regexps. --- osc/cmdln.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osc/cmdln.py b/osc/cmdln.py index 9ba96076..40832e36 100644 --- a/osc/cmdln.py +++ b/osc/cmdln.py @@ -118,12 +118,12 @@ def alias(*aliases): return decorate MAN_REPLACES = [ - (re.compile(r'(^|[ \t])--([^/ \t-]*)-([^/ \t-]*)-([^/ \t-]*)($|[ \t=])'), r'\1\-\-\2\-\3\-\4\5'), - (re.compile(r'(^|[ \t])-([^/ \t-]*)-([^/ \t-]*)-([^/ \t-]*)($|[ \t=])'), r'\1\-\2\-\3\-\4\5'), - (re.compile(r'(^|[ \t])--([^/ \t-]*)-([^/ \t-]*)($|[ \t=])'), r'\1\-\-\2\-\3\4'), - (re.compile(r'(^|[ \t])-([^/ \t-]*)-([^/ \t-]*)($|[ \t=])'), r'\1\-\2\-\3\4'), - (re.compile(r'(^|[ \t])--([^/ \t-]*)($|[ \t=])'), r'\1\-\-\2\3'), - (re.compile(r'(^|[ \t])-([^/ \t-]*)($|[ \t=])'), r'\1\-\2\3'), + (re.compile(r'(^|[ \t\[\'])--([^/ \t-]*)-([^/ \t-]*)-([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\-\2\-\3\-\4\5'), + (re.compile(r'(^|[ \t\[\'])-([^/ \t-]*)-([^/ \t-]*)-([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\2\-\3\-\4\5'), + (re.compile(r'(^|[ \t\[\'])--([^/ \t-]*)-([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\-\2\-\3\4'), + (re.compile(r'(^|[ \t\[\'])-([^/ \t-]*)-([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\2\-\3\4'), + (re.compile(r'(^|[ \t\[\'])--([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\-\2\3'), + (re.compile(r'(^|[ \t\[\'])-([^/ \t-]*)($|[ \t=\]\'])'), r'\1\-\2\3'), ] def man_escape(text):