2009-08-12 3 views

답변

14

일치를 생성하고 find()을 사용하여 다음 일치시에 위치 시키십시오.

int countMatches(Pattern pattern, String str) { 
    int matches = 0; 
    Matcher matcher = pattern.matcher(str); 
    while (matcher.find()) 
    matches++; 
    return matches; 
} 
: 여기
관련 문제