mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
11 lines
289 B
Python
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
|