반응형 Regular Expression1 Regular Expression Java [abc] [abc] : a, b or c 괄호안에 있는 문자가 존재하면 true(연결된것은 안됨) public class Test { public static void main(String[] args) { Pattern pattern = Pattern.compile("[ABCD]"); Matcher matcher = pattern.matcher("A"); System.out.println(matcher.matches()); }}결과 : true if문 쓰는것보다 훨씬 유용한것 같다. 2011. 9. 16. 이전 1 다음 728x90 반응형