(JAVA) 자바 정규표현식 Regular Expression
문자열을 검증하는 방법으로 사용한다. [ ] 한개의 문자 \d 한 개의 숫자 [0-9]와 동일 \s 공백 \w 한 개의 알파벳 또는 한 개의 숫자 ? 없음 또는 한개 * 없음 또는 한개 이상 + 한개 이상 {n} 정확히 n개 {n,} 최소한 n개 {n,m} n개부터 m개까지 ( ) 그룹핑 public class zzzzz { public static void main(String[] args) { //정구 표현식 문자열 검증 boolean result = Pattern.matches("[abc]", "a"); //true boolean result2 = Pattern.matches("[abc]", "e"); //false //abc 이외의 하나의 문자 boolean result3 = Pattern.mat..
JAVA
2017. 2. 12. 04:07
최근에 올라온 글
최근에 달린 댓글