import re
regex = re.compile(r"(?i)\b(baba(ji)?|fifa.*coins?|fifabay|(hotmail|gmail|outlook) ?(password( recovery)?|tech)? (support|contact|telephone) number|nike|tosterone|bajotz|vashi?k[ae]r[ae]n|sumer|kolcak|porn|molvi|judi bola|ituBola.com|lost lover|11s|acai|skin care|rejuvenated skin|LifeForce|swtor2credits|me2.do|black magic|bam2u|Neuro(3X|flexyn)|Nutra|TesteroneXL|Bowtrol|Slim ?Genix|Cleanse EFX|Babyliss ?Pro|Forskolin|Blackline Elite|TestCore Pro|Xtreme Antler|Maxx Test 3000|Cheap Wigs?|jivam|(Improve )?Brain Power|aging skin|acne( prone)? skin|(skin )?eye serum|skin (serum|eye)|(fake|original) (passports?|driver'?s? licen[cs]e|ID cards?)|bagprada|6611165613)\b|ಌ|(support|service|helpline)( phone)? number|1[ -]?[ -]?866[ -]?[ -]?978[ -]?6[ -]?819|(>>>>|===>|==>>>)(?s).*htt", flags=re.UNICODE)
test_str = ("Gmail Tech Support (1-844-202-5571) Gmail tech support number[Toll Free Number]?\n"
"<>1 - 866-978-6819<>gmail password reset//gmail contact number//gmail customer service//gmail help number\n"
"Hotmail technical support1 - 844-780-67 62 telephone number Hotmail support helpline number\n"
"[[[[[1-844-202-5571]]]]]Gmail Tech support[*]Gmail tech support number\n"
"@@<>1 -866-978-6819 FREE<><><::::::@Gmail password recovery telephone number\n"
"1 - 844-780-6762 outlook password recovery number-outlook password recovery contact number-outlook password recovery helpline number")
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