diff --git a/src/app/project/collaboration/add-user/add-user.component.ts b/src/app/project/collaboration/add-user/add-user.component.ts index 8d2b91eeb3..e6434d72ad 100644 --- a/src/app/project/collaboration/add-user/add-user.component.ts +++ b/src/app/project/collaboration/add-user/add-user.component.ts @@ -149,11 +149,11 @@ export class AddUserComponent implements OnInit { // if the user is already member of the project // add the email to the list of existing this.existingEmailInProject.push( - new RegExp('(?:^|\W)' + m.email.toLowerCase() + '(?:$|\W)') + new RegExp('(?:^|W)' + m.email.toLowerCase() + '(?:$|W)') ); // add username to the list of existing this.existingUsernameInProject.push( - new RegExp('(?:^|\W)' + m.username.toLowerCase() + '(?:$|\W)') + new RegExp('(?:^|W)' + m.username.toLowerCase() + '(?:$|W)') ); } @@ -163,11 +163,11 @@ export class AddUserComponent implements OnInit { // if the user is already member of the project // add the email to the list of existing this.existingEmails.push( - new RegExp('(?:^|\W)' + u.email.toLowerCase() + '(?:$|\W)') + new RegExp('(?:^|W)' + u.email.toLowerCase() + '(?:$|W)') ); // add username to the list of existing this.existingUsernames.push( - new RegExp('(?:^|\W)' + u.username.toLowerCase() + '(?:$|\W)') + new RegExp('(?:^|W)' + u.username.toLowerCase() + '(?:$|W)') ); let existsInProject = ''; diff --git a/src/app/project/project-form/project-form.component.ts b/src/app/project/project-form/project-form.component.ts index 2f625ac270..b62a2e346b 100644 --- a/src/app/project/project-form/project-form.component.ts +++ b/src/app/project/project-form/project-form.component.ts @@ -172,10 +172,10 @@ export class ProjectFormComponent implements OnInit { for (const project of response.body.projects) { - this.existingShortNames.push(new RegExp('(?:^|\W)' + project.shortname.toLowerCase() + '(?:$|\W)')); + this.existingShortNames.push(new RegExp('(?:^|W)' + project.shortname.toLowerCase() + '(?:$|W)')); if (project.shortcode !== null) { - this.existingShortcodes.push(new RegExp('(?:^|\W)' + project.shortcode.toLowerCase() + '(?:$|\W)')); + this.existingShortcodes.push(new RegExp('(?:^|W)' + project.shortcode.toLowerCase() + '(?:$|W)')); } } },