moviewyrm/bookwyrm/utils/regex.py

9 lines
318 B
Python
Raw Normal View History

2020-11-01 18:57:17 +00:00
''' defining regexes for regularly used concepts '''
domain = r'[a-z-A-Z0-9_\-]+\.[a-z]+'
2020-12-31 01:36:35 +00:00
localname = r'@?[a-zA-Z_\-\.0-9]+'
2021-01-01 15:27:56 +00:00
strict_localname = r'@[a-zA-Z_\-\.0-9]+'
2020-12-31 01:36:35 +00:00
username = r'%s(@%s)?' % (localname, domain)
2021-01-01 15:27:56 +00:00
strict_username = r'%s(@%s)?' % (strict_localname, domain)
2020-12-31 01:36:35 +00:00
full_username = r'%s@%s' % (localname, domain)