Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit f9e386a

Browse files
committed
Improve SORT_REGEX
1 parent ab12288 commit f9e386a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/views/rooms/MemberList.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ const INITIAL_LOAD_NUM_MEMBERS = 30;
3232
const INITIAL_LOAD_NUM_INVITED = 5;
3333
const SHOW_MORE_INCREMENT = 100;
3434

35-
// Regex applied to member names before applying sort, to fuzzy it a little
36-
const SORT_REGEX = /[.?!,;:\-()[\]{}'"&@#\\/+_=]+/g;
35+
// Regex applied to filter our punctuation in member names before applying sort, to fuzzy it a little
36+
// matches all ASCII punctuation: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
37+
const SORT_REGEX = /[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\x7E]+/g;
3738

3839
module.exports = createReactClass({
3940
displayName: 'MemberList',

0 commit comments

Comments
 (0)