lovespring
lovespring

Reputation: 19589

About regex in Dreamweaver

How to replace this:

<img src="<?php bloginfo('template_directory')?>/images/gallery_1(maybe 2 or 3, etc.).gif"><br>

to this:

<a href="#"><img src="<?php bloginfo('template_directory')?>/images/gallery_1(the same as the above).gif"><br></a>

Upvotes: 1

Views: 137

Answers (2)

sudipto
sudipto

Reputation: 2482

Find:

(\<img src="[^"]+?"\>\<br\>)

Replace:

<a href="#">$1</a>

Upvotes: 1

Tomalak
Tomalak

Reputation: 338326

Replace

<img src="\([^"]+\)"><br>

With

<a href="#"><img src="\1"><br></a>

As an aside, your <a> really should not contain a <br>. Better: Make it display: block; with CSS.

Upvotes: 1

Related Questions