Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
simplified regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Izmailov committed Oct 3, 2021
1 parent d493e75 commit 419578b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/innonymous/components/Register.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {Cookies, withCookies} from 'react-cookie';


class Register extends React.Component {
static nameRegex = '^[A-Za-z0-9А-Яа-яЁё][A-Za-z0-9А-Яа-яЁё \\-_]{0,30}[A-Za-z0-9А-Яа-яЁё]$';
static nameRegex = /^[\p{Letter}0-9][\p{Letter}0-9\-_\s]{0,30}[\p{Letter}0-9]$/u;
static goodNameMessage = 'Great name :3';
static nameRestrictionsMessage = '2-32 characters (A-z, 0-9, _, -)';
static propTypes = {cookies: instanceOf(Cookies).isRequired};
Expand Down
2 changes: 1 addition & 1 deletion src/innonymous/components/menu/CreateRoomForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Api from "../../Api";


class CreateRoomForm extends React.Component {
static nameRegex = '^[A-Za-z0-9А-Яа-яЁё][A-Za-z0-9А-Яа-яЁё \\-_]{3,30}[A-Za-z0-9А-Яа-яЁё]$';
static nameRegex = /^[\p{Letter}0-9][\p{Letter}0-9\-_\s]{3,30}[\p{Letter}0-9]$/u;
static goodNameMessage = 'Great name :3';
static nameRestrictionsMessage = '5-32 characters (A-z, 0-9, _, -)';
static propTypes = {cookies: instanceOf(Cookies).isRequired};
Expand Down

0 comments on commit 419578b

Please sign in to comment.