Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test {
- public static void main(String args[]){
- System.out.println(this.validate("FMIS")); // return true
- System.out.println(this.validate("[]pc")); // return false
- }
- public static boolean validate(String name) {
- return name.matches("([0-9a-zA-Z._-]+)");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement