0
태그 사이에 텍스트를 가져 오는 기능은 다음과 같습니다. 태그를 returing하는 것은 물론 정규식이 잘못되었음을 알려줍니다.자바 정규식을 사용하여 getTextBetweenTags 함수
String.prototype.getTextBetweenTags = 함수 (태그 명) {
var pattern = "<" + tagname + " ?.*>(.*)</" + tagname + ">";
return this.match(pattern)[0];
}
창 <title>hello</title>
이 결과의 첫 번째 요소는 단지 헬로
더 좋은 방법을 제안 할 수 있습니까? – user602291