
Estou tentando isso há uma hora e não consigo encontrar a expressão regular correta, alguma ideia?
Esse:
src="https://www.mywebsite.com/embedframe/84398934/need-this-text-and-the-forward-slash-before-it-removed" frameborder="0" width="600" height=" 400" scrolling="não" permitfullscreen="allowfullscreen">
Para isso:
src="https://www.mywebsite.com/embedframe/84398934" frameborder="0" width="600" height="400" scrolling="no"allowfullscreen="allowfullscreen">
Responder1
Usando o Notepad++ (o bloco de notas não suporta regex):
- Ctrl+H
- Encontre o que:
src="https://.*\K/[^/"]+(?=")
- Substituir com:
LEAVE EMPTY
- confira Envolver
- verifique expressão regular
- Replace all
Explicação:
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
Resultado para determinado exemplo:
src="https://www.mywebsite.com/embedframe/84398934" frameborder="0" width="600" height="400" scrolling="no" allowfullscreen="allowfullscreen">
Captura de tela: