import re
regex = re.compile(r"\?ÕÌ_|Š|Ž|À|Á|Â|Ã|Ä|Å|Æ|Ç|È|É|Ê|Ë|Ì|Í|Î|Ï|Ñ|Ò|Ó|Ô|Õ|Ö|Ø|Ù|Ú|Û|Ü|Ý|Þ|ß|ð|ÿ|_Œ‚|__|_", flags=re.IGNORECASE)
test_str = ("?ÕÌ_\n"
"Š\n"
"š\n"
"Ž\n"
"ž\n"
"À\n"
"Á\n"
"Â\n"
"Ã\n"
"Ä\n"
"Å\n"
"Æ\n"
"Ç\n"
"È\n"
"É\n"
"Ê\n"
"Ë\n"
"Ì\n"
"Í\n"
"Î\n"
"Ï\n"
"Ñ\n"
"Ò\n"
"Ó\n"
"Ô\n"
"Õ\n"
"Ö\n"
"Ø\n"
"Ù\n"
"Ú\n"
"Û\n"
"Ü\n"
"Ý\n"
"Þ\n"
"ß\n"
"à\n"
"á\n"
"â\n"
"ã\n"
"ä\n"
"å\n"
"æ\n"
"ç\n"
"è\n"
"é\n"
"ê\n"
"ë\n"
"ì\n"
"í\n"
"î\n"
"ï\n"
"ð\n"
"ñ\n"
"ò\n"
"ó\n"
"ô\n"
"õ\n"
"ö\n"
"ø\n"
"ù\n"
"ú\n"
"û\n"
"ý\n"
"þ\n"
"ÿ\n"
"_Œ‚\n"
"__\n"
"_\n")
matches = regex.finditer(test_str)
for match_num, match in enumerate(matches, start=1):
print(f"Match {match_num} was found at {match.start()}-{match.end()}: {match.group()}")
for group_num, group in enumerate(match.groups(), start=1):
print(f"Group {group_num} found at {match.start(group_num)}-{match.end(group_num)}: {group}")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html