Web: People: Replace RegExp

This commit is contained in:
Tatiana Lopaeva 2021-10-05 16:01:03 +03:00
parent 48395596bc
commit 65a2672b31

View File

@ -217,10 +217,13 @@ class UpdateUserForm extends React.Component {
let value = event.target.value;
let title = event.target.name;
const regexp = /[\[\]\d+=:!@#$%^&*(){}±§<>+;"'~`№,._|\/\\]/g;
if (regexp.test(value)) {
const regexp = /^[\p{L}\p{M}'\-]+$/gu;
const isValid = regexp.test(value);
if (!isValid) {
stateCopy.errors[title] = true;
} else {
if (this.state.errors[title]) stateCopy.errors[title] = false;
}