- Ctrl + H
- Trouvez ce que:
^\h*<img src=("[^"]+")>
- Remplacer par:
<a target="_blank" href="$1">\n$0
- check Enrouler
- check Expression régulière NE PAS VOIR
. matches newline
- Remplacer tous
Explication:
^ : begining of line
\h* : 0 or more horizontal spaces (space or tabulation)
<img src= : literally <img src=
( : start group 1
"[^"]+" : 1 or more non quote character between quotes
) : end group 1
> : literally >
remplacement:
<a target="_blank" href="$1"> : <a...> tag, with value in group 1 (ie. image filename)
\n : linebreak (you could use "\r\n")
$0 : content of group 0 (ie. the whole match: <img ...>)
Résultat par exemple donné:
<a target="_blank" href="img_forest.jpg"">
<img src="img_forest.jpg">
<a target="_blank" href="img_forest110.jpg"">
<img src="img_forest110.jpg">
<a target="_blank" href="img_forest228.jpg"">
<img src="img_forest228.jpg">
<a target="_blank" href="img_forest334.jpg"">
<img src="img_forest334.jpg">
Quel langage de programmation utilisez-vous pour générer le code? Ou voulez-vous utiliser Javascript? –
j'utilise notepad ++ –
remplacer '