code / MSI_High_matching.py
jkushwaha's picture
Update MSI_High_matching.py
85e39b4 verified
raw
history blame contribute delete
460 Bytes
import re
keys = ['dmmr', 'deficient mismatch repair', 'hypermutation','lynch syndrome']
words = ['i like apples', 'i have a banana', 'oranges are tasty']
# Create regex pattern
pattern = r'\b(?:' + '|'.join(keys) + r')\b'
# Compile regex pattern
regex = re.compile(pattern)
# Check for matches
for word in words:
if regex.search(word.lower()):
print(f"At least one key found in '{word}'")
else:
print(f"No keys found in '{word}'")