import re
regex = re.compile(r"\bhome[\W_]+based[\W_]+online[\W_]+job(?:s)?\b", flags=re.MULTILINE | re.IGNORECASE)
test_str = ("We are Hiring - Earn Rs.15000/- Per month - Simple Copy Paste Jobs\n\n"
"Earn Rs.25000/- per month - Simple online Jobs - Are You Looking for Home-Based Online Jobs? - Are You a Student, Housewife, jobseeker ? - Are you ready to Work 1 to 2 Hours daily Online? - Do You need Guaranteed Payment Monthly? Then this is for You, - Clicking on their Advertisement E-mails. - Submitting their Data's online. - Reading their Advertisement Sms. - Filling Forms on their websites, etc,. FREE to Join >> http://dailyonlinejobs.com DPJ4602162 07 10 2019 20:20:50\n\n"
"http://www.4cashpath.com/ My last month's online earning was $17593 just by doing an easy job online. Easiest home based online job to earn extra dollars every month just by doing work for maximum 2 to 3 hrs a day. I have joined this job about 3 months ago and in my first month i have made $12k+ easily without any special online experience. Everybody on this earth can get this job today and start making cash online by just follow details on this website.........")
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