Skip to content

Commit

Permalink
Use common regular expressions from ValidationUtils.
Browse files Browse the repository at this point in the history
Change-Id: Ib64f9d8228c28b1a4479d0e9ed4d27b06836a4c7
Signed-off-by: Shmuel Melamud <smelamud@redhat.com>
  • Loading branch information
smelamud authored and ahadas committed Jun 21, 2022
1 parent 349d1d8 commit b4dda15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.ovirt.engine.core.common.job.StepEnum;
import org.ovirt.engine.core.common.queries.IdQueryParameters;
import org.ovirt.engine.core.common.queries.QueryType;
import org.ovirt.engine.core.common.utils.ValidationUtils;
import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
import org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase;
import org.ovirt.engine.core.compat.Guid;
Expand All @@ -75,7 +76,8 @@ public class ImportVmFromExternalProviderCommand<T extends ImportVmFromExternalP

private static final Pattern VMWARE_DISK_NAME_PATTERN = Pattern.compile("\\[.*?\\] .*/(.*).vmdk");
private static final Pattern DISK_NAME_PATTERN = Pattern.compile(".*/([^.]+).*");
private static final Pattern DISK_ALIAS_ILLEGAL_CHARS_PATTERN = Pattern.compile("[^\\w.-]");
private static final Pattern DISK_ALIAS_ILLEGAL_CHARS_PATTERN =
Pattern.compile("[^" + ValidationUtils.NO_SPECIAL_CHARACTER_CLASS_I18N + "]");

private static final String VDSM_COMPAT_VERSION_1_1 = "1.1";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public class ValidationUtils {

public static final String NO_SPECIAL_CHARACTERS_EXTRA_I18N = "^[\\p{L}0-9._\\+-]*$";
public static final String CUSTOM_CPU_NAME = "^[\\p{L}0-9._\\+\\-,]*$";
public static final String NO_SPECIAL_CHARACTERS_I18N = "^[\\p{L}0-9._-]*$";
public static final String NO_SPECIAL_CHARACTER_CLASS_I18N = "\\p{L}0-9._-";
public static final String NO_SPECIAL_CHARACTERS_I18N = "^["+ NO_SPECIAL_CHARACTER_CLASS_I18N + "]*$";
public static final String NO_SPECIAL_CHARACTERS = "[0-9a-zA-Z_-]+";
public static final String ONLY_I18N_ASCII_OR_NONE = "[\\p{ASCII}\\p{L}]*";
public static final String ONLY_ASCII_OR_NONE = "[\\p{ASCII}]*";
Expand Down

0 comments on commit b4dda15

Please sign in to comment.