2
findText (searchPattern) 메소드를 사용하여 Google 문서에서 문자열을 찾고 싶습니다. 내 된 searchPattern는 다음과 같은 정규 표현식이다 :findText with regexp
var doc = DocumentApp.getActiveDocument().getBody();
var textToHighlight = '';
textToHighlight = new RegExp( "this");
textLocation = doc.findText(textToHighlight);
그러나 대신 텍스트를 검색 나에게 다음과 같은 오류를 준 :
Google 애플리케이션 스크립트 : 인수는 null 일 수 없습니다 : 프롬프트
I Text 클래스에서 findText 메소드의 문서를 읽으십시오. 여기서 searchPattern을 문자열로 지정합니다. regexp를 사용하여 텍스트를 찾는 다른 방법이 있습니까?
감사합니다.