How to remove height / width using regex from image in Dreamweaver

This tutorial is meant to give an idea to the developers about how they can use regex to remove or replace certain code from their source code using regex feature in adobe dreamweaver.

For instance, consider an example page with this type of code in it repeating again and again on the entire page:

<img src="images/image_1.jpg" alt="" width="100" height="50" />

Assume that this code is repeated all over the page showing different images with different height and width (or similar too)

Now suppose you want to remove height or image in this piece of code.

Open the file in dreamviewer and switch to code view.

Click ctrl + F to open the find / replace window. There paste the following code and select the “regex” checkbox so that dreamweaver processes the command as regular expression.

width="[^"]*" height="[^"]*"

Now we can either replace this part of code with nothing (empty) using dreamweaver replace function or with some other height and with (to make all images of same height and width on the webpage)

Possibilities are endless!

Let me know if you have any queries related to this.

Leave a Reply

Your email address will not be published.