1
내가 사용하는 경우 내가 왜 이해가 안 :정규 표현식 Pattern.MULTILINE 문제
boolean found = Pattern.compile("^\\d", Pattern.MULTILINE).matcher("dfg\n5t").find();
, 그것은 true를 반환합니다.
내가 사용하지만 경우
// taken from two input field with the same above values!!!
String rx = txt_rx.getText();
String ch = txt_ch.getText();
boolean found = Pattern.compile(rx, Pattern.MULTILINE).matcher(ch).find();
, false를 돌려줍니다.
감사합니다.
안녕하십니까,'rx'와'ch'가 어디에서 사용되는지 명확히 알 수있는 전체 소스 코드를 게시 할 수 있습니까? –
나는'rx','ch'를 표준 출력 (또는 디버거에서 검사)에 인쇄 할 것을 제안합니다. 단순히 그들이 당신이 생각하는 것과는 다른 sth이어야합니다. –
getText에 의해 반환 된 문자열은 문자열 리터럴과 같습니다. – xdevel2000