package com.nuclearthinking.game.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by onifent
 */

public class Writer {

    public String getUserInput() {
        String input = null;
        try {
            BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
            input = is.readLine();

        } catch (IOException e) {
            e.printStackTrace();
        }
        return input;
    }

    private boolean checkInput(String input) {
        boolean valid = true;

        if (input.trim().length() == 0) {
            valid = false;
        }


        return valid;
    }

}

@@ -126,16 +126,80 @@
 mReader;
+%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;
 %0A%0A/**%0A *
@@ -611,132 +611,124 @@
     
-boolean valid = true;%0A%0A        if (input.trim().length() == 0) %7B%0A            valid = false
+Pattern p = Pattern.compile(%22%5E%5B-a-z0-9_-%5D%7B1,15%7D$%22);%0A        Matcher m = p.matcher(input)
 ;%0A  
- 
-     %7D%0A%0A%0A
       
-  
 return 
-valid
+m.matches()
 ;%0A  
@@ -732,10 +732,11 @@
 %0A    %7D%0A%0A
+%0A
 %7D%0A

change ceckInput to regex matcher