it.ssc.util.TestValidName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsr331-ssc Show documentation
Show all versions of jsr331-ssc Show documentation
This is a JSR331 interface for SSC (Software for the Calculation of the Simplex) is a java library for solving linear programming problems v. 3.0.1.
SSC was designed and developed by Stefano Scarioli.
The newest version!
package it.ssc.util;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TestValidName {
public static boolean isValidNameLibrary(String name) {
Pattern pattern_azioni = Pattern.compile("\\p{Alpha}+[_\\p{Alnum}]*");
Matcher matcher_azioni = pattern_azioni.matcher(name);
if (matcher_azioni.matches()) {
return true;
}
return false;
}
public static boolean isValidNameDataset(String name) {
Pattern pattern_azioni = Pattern.compile("\\p{Alpha}+[_\\p{Alnum}]*");
Matcher matcher_azioni = pattern_azioni.matcher(name);
//SAS
Pattern pattern_azioni2 = Pattern.compile("\\p{Alpha}+[_\\p{Alnum}]*\\.\\p{Alpha}+[_\\p{Alnum}]*");
Matcher matcher_azioni2 = pattern_azioni2.matcher(name);
if (matcher_azioni.matches()) {
return true;
}
else if (matcher_azioni2.matches()) {
return true;
}
return false;
}
}