Android Password Regex Match isValidUserNameOrPassword(String string)

Here you can find the source of isValidUserNameOrPassword(String string)

Description

is Valid User Name Or Password

Declaration

public static boolean isValidUserNameOrPassword(String string) 

Method Source Code

//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static boolean isValidUserNameOrPassword(String string) {
        Pattern pattern = Pattern.compile("^([a-zA-Z0-9_]+)$");
        Matcher matcher = pattern.matcher(string);
        if (matcher.find()) {
            return true;
        } else {//w  w w .j a  v a2  s.  com
            return false;
        }
    }
}

Related

  1. matchPwd(String pwd)
  2. checkpasswd(String passwd)