import re
regexes = [
"foo.*",
"bar.*",
"qu*x"
]
# Make a regex that matches if any of our regexes match.
combined = "(" + ")|(".join(regexes) + ")"
if re.match(combined, mystring):
print "Some regex matched!"
More Related Contents:
- How to add numbers inside a variable? [closed]
- Is there a way to ordinate numbers in a list?
- finding the biggest sequence of repeating numbers in a list
- Remove all the elements that occur in one list from another
- Finding the average of a list
- Remove duplicate dict in list in Python
- How to efficiently compare two unordered lists (not sets) in Python?
- How to check for valid email address? [duplicate]
- Negative list index? [duplicate]
- list to dictionary conversion with multiple values per key?
- Appending a dictionary to a list – I see a pointer like behavior
- Appending item to lists within a list comprehension
- How to extract an IP address from an HTML string?
- Does python have a sorted list?
- Tuple unpacking order changes values assigned
- Reversing a list using slice notation
- How would I get everything before a : in a string Python
- Writing Python lists to columns in csv
- How to access the elements of a 2D array?
- Why does a for-loop with pop-method (or del statement) not iterate over all list elements [duplicate]
- Why does using multiplication operator on list create list of pointers? [duplicate]
- How do I extract all the values of a specific key from a list of dictionaries?
- creating a defaultlist in python
- Converting list to *args when calling function [duplicate]
- Assign multiple values of a list
- Creating a custom categorized corpus in NLTK and Python
- Deleting consonants from a string in Python
- Counting depth or the deepest level a nested list goes to
- Which is the most efficient way to iterate through a list in python?
- Issue with regex backreference in Python