diff --git a/tools/daca2-report.py b/tools/daca2-report.py index 482cdcd63..437793a63 100644 --- a/tools/daca2-report.py +++ b/tools/daca2-report.py @@ -94,6 +94,7 @@ for severity in ['error', 'warning', 'style', 'portability', 'performance']: categories[severity] = [] daca2 = daca2folder +pattern = re.compile(r'.*: (error|warning|style|performance|portability):.* \[([a-zA-Z0-9_\\-]+)\]') for lib in (False, True): for a in "0123456789abcdefghijklmnopqrstuvwxyz": if lib: @@ -120,7 +121,7 @@ for lib in (False, True): datestr = '' for line in data.split('\n'): - res = re.match(r'.*: (error|warning|style|performance|style|portability):.* \[([a-zA-Z0-9_\\-]+)\]', line) + res = pattern.match(line) if res is None: continue severity = res.group(1) diff --git a/tools/daca2-search.cgi b/tools/daca2-search.cgi index dde8452fb..61cafe2e2 100755 --- a/tools/daca2-search.cgi +++ b/tools/daca2-search.cgi @@ -53,10 +53,10 @@ def doSearch(path,arguments): def summary(path, arguments): count = {} + pattern = re.compile(r'.*: (error|warning|style|performance|portability):.*\[([a-zA-Z0-9]+)\]$') for g in getfiles(path, arguments): for line in readlines(g): - line = trimline(line) - res = re.match(r'.*: (error|warning|style|performance|portability):.*\[([a-zA-Z0-9]+)\]$', line) + res = pattern.match(trimline(line)) if res is None: continue id = res.group(2)