loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import re

laughter_regex = r'\b(a*ha+h[ha]*|o?l+o+l+[ol]*|lma[o]+)\b'
curse_regex = r'\b([s]+[h]+[i]+[t]+|[f]+[u]+[c]+[k]+|[b]+[i]+[t]+[c]+[h]+)\b'
link_regex = r'http[s]?://(?:[a-zA-Z]|[0-9]|[[email protected]&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+'

test_laugh_text = 'lolll'
test_curse_text = 'shitt'
test_link_text = 'https://andcomputers.io/'


match_laugh = re.search(laughter_regex,test_laugh_text)
match_curse = re.search(curse_regex,test_curse_text)
match_link = re.search(link_regex,test_link_text)

print("matched laugh {bool}: {val}".format(bool=bool(match_laugh),val=match_laugh.group()))

print("matched curse {bool}: {val}".format(bool=bool(match_curse),val=match_curse.group()))

print("matched link {bool}: {val}".format(bool=bool(match_link),val=match_link.group()))