fix #10128: use User.USERNAME_REGEX
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / annotatedlineeditor / e4 / handler / NewObjectHandler.java
index 3a1cdf34a795450057ede75a0b72223374947fc9..8ab75bdbafd74a0dadb43268cd1c46548c1c29d4 100644 (file)
@@ -23,6 +23,7 @@ import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.permission.User;
 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditor;
@@ -63,7 +64,7 @@ public class NewObjectHandler {
                 nonEmptyInputValidator = new IInputValidator() {
                     @Override
                     public String isValid(String text) {
-                        if(text == null || text.isEmpty() || !text.matches("[[_.-]*\\w*]*")) {
+                        if(text == null || text.isEmpty() || !text.matches(User.USERNAME_REGEX)) {
                             return Messages.GROUP_CREATOR_Name_not_accepted_message;
                         }
                         return null;