Skip to content

Commit

Permalink
Merge pull request #29168 from jayeshmangwani/update_room_name_regex_…
Browse files Browse the repository at this point in the history
…to_latin_script
  • Loading branch information
thienlnam authored Oct 10, 2023
2 parents b5445bd + aeca58b commit 11acdc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ const CONST = {
CARD_NUMBER: /^[0-9]{15,16}$/,
CARD_SECURITY_CODE: /^[0-9]{3,4}$/,
CARD_EXPIRATION_DATE: /^(0[1-9]|1[0-2])([^0-9])?([0-9]{4}|([0-9]{2}))$/,
ROOM_NAME: /^#[a-z0-9à-ÿ-]{1,80}$/,
ROOM_NAME: /^#[\p{Ll}0-9-]{1,80}$/u,

// eslint-disable-next-line max-len, no-misleading-character-class
EMOJIS: /[\p{Extended_Pictographic}](\u200D[\p{Extended_Pictographic}]|[\u{1F3FB}-\u{1F3FF}]|[\u{E0020}-\u{E007F}]|\uFE0F|\u20E3)*|[\u{1F1E6}-\u{1F1FF}]{2}|[#*0-9]\uFE0F?\u20E3/gu,
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/ValidationUtilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ describe('ValidationUtils', () => {
test('room name with spanish Accented letters and dashes', () => {
expect(ValidationUtils.isValidRoomName('#sala-de-opinión')).toBe(true);
});

test('room name with division sign (÷)', () => {
expect(ValidationUtils.isValidRoomName('#room-name-with-÷-sign')).toBe(false);
});

test('room name with Greek alphabets and Cyrillic alphabets', () => {
expect(ValidationUtils.isValidRoomName('#σοβαρός-серьезный')).toBe(true);
});
});

describe('isValidWebsite', () => {
Expand Down

0 comments on commit 11acdc2

Please sign in to comment.