전체 글 49

오늘의 유머 - 프로그래머 게시판 6918 번

프게글 풀이 import java.util.regex.Matcher;import java.util.regex.Pattern; public class Main { public static void main(String[] args){ String str = "국가 (0,2)(1,1)(2,1)(6,1)(8,1)(12,1)"; Pattern p = Pattern.compile("\\((\\d+),(\\d+)\\)"); Matcher m = p.matcher(str); System.out.println("괄호 포함, 괄호 안 전체"); while (m.find()){ System.out.println(m.group()); } m.reset(); System.out.println("괄호 안, 콤마 왼쪽"); wh..

카테고리 없음 2014.12.04