pre-commit-hooks/pre_commit_hooks/loaderon-hooks/util/string_helpers.py
Alvaro Andrés Rodríguez Scelza 0a66e6635d Added loaderon-hooks logic
2019-06-02 02:10:25 -03:00

11 lines
289 B
Python

# -*- coding: utf-8 -*-
import re
def matches_any_regexp(string, regexp_list):
"""Checks if string matches any of regexp in regexp_list."""
for regexp in regexp_list:
pattern = re.compile(regexp)
if pattern.match(string):
return True
return False