Created
June 3, 2018 20:56
-
-
Save nokados/c1e62d7b38e5fc80cb1eb971c3721e6b to your computer and use it in GitHub Desktop.
Closure. Check if a string includes a pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def has(expr): | |
return lambda x: bool(re.search(expr, x, flags=re.IGNORECASE|re.MULTILINE|re.DOTALL)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment