
He estado intentando esto durante una hora y parece que no puedo encontrar la expresión regular correcta. ¿Alguna idea?
Este:
src="https://www.mywebsite.com/embedframe/84398934/need-this-text-and-the-forward-slash-before-it-removed" frameborder="0" width="600" height=" 400" desplazamiento="no" enablefullscreen="allowfullscreen">
A esto:
src="https://www.mywebsite.com/embedframe/84398934" frameborder="0" width="600" height="400" scrolling="no" enablefullscreen="allowfullscreen">
Respuesta1
Usando Notepad++ (el bloc de notas no admite expresiones regulares):
- Ctrl+H
- Encontrar que:
src="https://.*\K/[^/"]+(?=")
- Reemplazar con:
LEAVE EMPTY
- comprobar Envolver alrededor
- comprobar expresión regular
- Replace all
Explicación:
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 el ejemplo dado:
src="https://www.mywebsite.com/embedframe/84398934" frameborder="0" width="600" height="400" scrolling="no" allowfullscreen="allowfullscreen">
La captura de pantalla: