수천 개의 코드 파일이 있습니다. 앞으로는 메서드를 제거해야 하지만 인수는 같은 줄에 유지하고 싶습니다. Nodepad++의 정규식 문제를 해결하고 싶습니다.
메소드는 다음과 같습니다
self.result(lib.file.SetValue('set accelerator', False, subtitle='Disable mode(auto)'))
결과적으로 나는 다음 내용을 원합니다
lib.file.SetValue('set accelerator', False, subtitle='Disable mode(auto)')
self.result(
그래서 마지막 괄호를 제거해야 합니다 .)
다른 스레드에서 비슷한 문제를 발견했습니다.
두 문자열 사이의 내용을 제외한 모든 텍스트를 삭제하는 방법(Notepad++)
내가 다음을 할 수 없다는 것은 명백하다
검색:
self.result(([^))]*) #Match "self.result(" followed by any
#number of characters which are not "))"
replace with \1) #replace with what is in between and
#add a parentheses
누군가 나를 도와줄 수 있나요?
매우 감사합니다
답변1
메서드를 제거해야 하지만 인수를 같은 줄에 유지하고 싶습니다.
메뉴 "검색" > "바꾸기" (또는 Ctrl+ H)
"찾을 내용"을 로 설정합니다
self.result\((.*)\)\R
."바꾸기"를 다음으로 설정하세요.
\1
"정규식" 및 "개행 일치"를 활성화합니다.
"모두 바꾸기"를 클릭하세요
노트:
\r\n
Windows EOL에 사용\n
Unix/OSX EOL에 사용\r
Mac OS(버전 9까지) EOL에 사용또는
\R
모든 OS에서 작동하는 것을 사용하십시오.
전에:
self.result(lib.file.SetValue('set accelerator', False, subtitle='Disable mode(auto)'))
후에:
lib.file.SetValue('set accelerator', False, subtitle='Disable mode(auto)')