문자열에^기호가 포함되어 있는지 확인하고 사용자에게 메시지가 표시되는지 확인하고 싶습니다.자바 문자열에서^문자 확인
감사
Pattern p = Pattern.compile("[a-z0-9 ]", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher("StringGoesHere");
boolean b = m.find();
if (b){
System.out.println("bad");
} else {
System.out.println("fine");
}
그럼, 궁금한 점은 무엇입니까? – simchona
... 패턴에 추가하고'\ '로 이스케이프 처리하십시오. –