wahid
wahid

Reputation: 1150

Search at dream weaver using regular expression

Hello i am trying to find and replace all at Dreamweaver using regular expression.

My CSS:

.class1{
  position:relative;
  float:left;
  margin: 2px 1px 0px 0px;
} 

.class2{
  position:relative
  float:left;
  margin: 0px 1px 0px 0px;
}

Now i want to find all margin using regular expression and want to replace them by adding !important at the last.

Already i can find using regular expression by using this

margin:.*?;

Now i want to replace all margin with !important using regular expression at Dreamweaver. example

margin: 0px 1px 0px 0px !important;

can anybody give solution.

Upvotes: 3

Views: 61

Answers (1)

zx81
zx81

Reputation: 41838

Tested in DW CS6

Search: margin:((?:\s*\d+px)+)\s*;

Replace: margin:$1 !important;

I made the regex a bit specific so we don't add !important when we already have !important :)

Upvotes: 2

Related Questions