Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions app/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
from django.forms import ValidationError
from django.urls import reverse

regex_check = (r'(?!(\A( \x09\x0A\x0D\x20-\x7E # ASCII '
r'| \xC2-\xDF # non-overlong 2-byte '
r'| \xE0\xA0-\xBF # excluding overlongs '
r'| \xE1-\xEC\xEE\xEF{2} # straight 3-byte '
r'| \xED\x80-\x9F # excluding surrogates '
r'| \xF0\x90-\xBF{2} # planes 1-3 '
r'| \xF1-\xF3{3} # planes 4-15 '
r'| \xF4\x80-\x8F{2} # plane 16 )*\Z))')
regex_check = (
r'^(' # start at start
r'[\x09\x0A\x0D\x20-\x7E]' # ASCII
r'|[\xC2-\xDF]' # non-overlong 2-byte
r'|[\xE0\xA0-\xBF]' # excluding overlongs
r'|[\xE1-\xEC\xEE\xEF]{2}' # straight 3-byte
r'|[\xED\x80-\x9F]' # excluding surrogates
r'|[\xF0\x90-\xBF]{2}' # planes 1-3
r'|[\xF1-\xF3]{3}' # planes 4-15
r'|[\xF4\x80-\x8F]{2}' # plane 16
r')*$') # match all until end


class XISConfiguration(models.Model):
Expand Down
Loading