MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / validate_regex

Function validate_regex

addons/naming.py:15–20  ·  view source on GitHub ↗
(expr)

Source from the content-addressed store, hash-verified

13
14
15def validate_regex(expr):
16 try:
17 re.compile(expr)
18 except re.error:
19 print('Error: "{}" is not a valid regular expression.'.format(expr))
20 sys.exit(1)
21
22
23RE_VARNAME = None

Callers 1

naming.pyFile · 0.85

Calls 2

compileMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected