diff options
Diffstat (limited to 'coverage/misc.py')
-rw-r--r-- | coverage/misc.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/coverage/misc.py b/coverage/misc.py index 4f3748fe..ec0d0ff7 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -73,6 +73,14 @@ def bool_or_none(b): return bool(b) +def join_regex(regexes): + """Combine a list of regexes into one that matches any of them.""" + if len(regexes) > 1: + return "(" + ")|(".join(regexes) + ")" + else: + return regexes[0] + + class Hasher(object): """Hashes Python data into md5.""" def __init__(self): |