아래 자바 코드 행이 있습니다.자바에서 일치하는 문자열 정규 표현식?
String string1 = "SAMPLE STRING";
String string2 = "SAMPLE*";
string2 = string2.replaceAll("\\*",".*").trim().toUpperCase();
if(string1.matches(string2)){
System.out.println("true");
}else{
System.out.println("false");
}
여기서는 정규식의 의미를 이해하지 못합니다. 무슨 뜻이에요? 아무도 나를 도울 수 있습니까?
감사합니다.
당신의 문서를 통해 갈 수 있습니다 : - ['패턴 Class' (http://docs.oracle.com/javase/7/ docs/api/java/util/regex/Pattern.html) –