Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
93a10002
Commit
93a10002
authored
Jun 16, 2017
by
Daniel W Bond
Browse files
began excluding unicode blocks from valid names by removing emojis
parent
4c84b928
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/core/utils.py
View file @
93a10002
...
...
@@ -82,7 +82,18 @@ def create_email(text_path, html_path, subject, to, context):
def
no_nums
(
name
):
no_numbers
=
re
.
sub
(
'[0-9]'
,
''
,
name
)
emoji_pattern
=
re
.
compile
(
"["
u
"
\U0001F600
-
\U0001F64F
"
# emoticons
u
"
\U0001F300
-
\U0001F5FF
"
# symbols & pictographs
u
"
\U0001F680
-
\U0001F6FF
"
# transport & map symbols
u
"
\U0001F1E0
-
\U0001F1FF
"
# flags (iOS)
# exclude additional unicode blocks as necessary
# https://en.wikipedia.org/wiki/Unicode_block
"]+"
,
flags
=
re
.
UNICODE
)
no_emojis
=
emoji_pattern
.
sub
(
r
''
,
name
)
no_numbers
=
re
.
sub
(
'[0-9]'
,
''
,
no_emojis
)
return
no_numbers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment