
나는 이것을 한 시간 동안 시도했지만 올바른 정규식을 얻을 수 없는 것 같습니까?
이것:
src="https://www.mywebsite.com/embedframe/84398934/need-this-text-and-the-forward-slash-before-it-removed"frameborder="0" width="600" height=" 400" 스크롤="아니요"allowfullscreen="allowfullscreen">
이에:
src="https://www.mywebsite.com/embedframe/84398934"frameborder="0" width="600" height="400" scrolling="no" allowedfullscreen="allowfullscreen">
답변1
Notepad++ 사용(메모장은 정규식을 지원하지 않음):
- Ctrl+H
- 무엇을 찾다:
src="https://.*\K/[^/"]+(?=")
- 다음으로 교체:
LEAVE EMPTY
- 둘러보기 확인
- 정규식 확인
- Replace all
설명:
src="https:// # literally
.* # 0 or more any character
\K # forget all we have seen until this position
/ # a slash
[^/"]+ # 1 or more any character that is not slash or double quote
(?=") # positive lookahead, make sure we have a double quote after
주어진 예에 대한 결과:
src="https://www.mywebsite.com/embedframe/84398934" frameborder="0" width="600" height="400" scrolling="no" allowfullscreen="allowfullscreen">
화면 캡처: