Last active
February 3, 2017 02:25
-
-
Save brownsoo/476dd4174ce3a65adc3080ae63cd303f to your computer and use it in GitHub Desktop.
Regular expression to check if the string contains only number and char.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 문자열이 문자와 숫자로만 되어 있는지 확인 | |
public static boolean checkNumberCharMixed(@NonNull String password) { | |
Pattern p = Pattern.compile("^([0-9]+[a-zA-Z]+|[a-zA-Z]+[0-9]+)[0-9a-zA-Z]*$"); | |
return p.matcher(password).matches(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment