파일에 수백 개의 bib 참조가 있으며 다음 구문이 있습니다.
@article{tabata1999precise,
title={Precise synthesis of monosubstituted polyacetylenes using Rh complex catalysts.
Control of solid structure and $\pi$-conjugation length},
author={Tabata, Masayoshi and Sone, Takeyuchi and Sadahiro, Yoshikazu},
journal={Macromolecular chemistry and physics},
volume={200},
number={2},
pages={265--282},
year={1999},
publisher={Wiley Online Library}
}
정규식을 사용하여 메모장 ++에서 저널 이름의 제목(일명 적절한 경우)을 지정하고 싶습니다. 예를 들어 에서 Macromolecular chemistry and physics
까지 Macromolecular Chemistry and Physics
.
다음을 사용하여 모든 인스턴스를 찾을 수 있습니다.
(?<=journal\=\{).*?(?=\})
하지만 Edit > Convert Case to를 통해 케이스를 변경할 수 없습니다. 분명히 모두 찾기에서 작동하지 않으며 하나씩 가야합니다.
다음으로 매크로를 기록하고 실행하려고 시도했지만 메모장 ++을 실행하려고하면 무기한 중단됩니다 (파일 끝까지 실행하는 옵션).
그래서 제 질문은: 대소문자를 변경하는 데 사용할 수 있는 바꾸기 정규식 구문을 아는 사람이 있습니까? 이상적으로는 "|"도 사용하고 싶습니다. " of ", " an ", " " 등과 같은 특정 단어에 대한 제외. 여기 에 제공된 몇 가지 예를 사용하려고 시도했지만 내 예측에 통합할 수 없었습니다.
미리 감사드립니다. 도움을 주시면 감사하겠습니다.
이것은 단어 수에 관계없이 작동합니다.
(?:journal={|\G)\K(?:(\w{4,})|(\w+))(\h*)
\u$1\E$2$3
설명:
(?: # non capture group
journal={ # literally
| # OR
\G # restart from last match position
) # end group
\K # forget all we have seen until this position
(?: # non capture group
(\w{4,}) # group 1, a word with 4 or more characters
| # OR
(\w+) # group 2, a word of any length
) # end group
(\h*) # group 3, 0 or more horizontal spaces
바꿔 놓음:
\u # uppercased the first letter of the following
$1 # content of group 1
\E # stop the uppercased
$2 # content of group 2
$3 # content of group 3
스크린샷(이전):
스크린샷(후):
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다