From 85a7e83340762c78433cd44a7972e7e1482b7e9a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 1 Nov 2020 10:57:17 -0800 Subject: [PATCH] Adds regex util file --- bookwyrm/utils/regex.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 bookwyrm/utils/regex.py diff --git a/bookwyrm/utils/regex.py b/bookwyrm/utils/regex.py new file mode 100644 index 00000000..36e211d9 --- /dev/null +++ b/bookwyrm/utils/regex.py @@ -0,0 +1,5 @@ +''' defining regexes for regularly used concepts ''' + +domain = r'[a-z-A-Z0-9_\-]+\.[a-z]+' +username = r'@[a-zA-Z_\-\.0-9]+(@%s)?' % domain +full_username = r'@[a-zA-Z_\-\.0-9]+@%s' % domain