Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 使用正则表达式搜索dream weaver_Css_Regex - Fatal编程技术网

Css 使用正则表达式搜索dream weaver

Css 使用正则表达式搜索dream weaver,css,regex,Css,Regex,您好,我正在尝试使用正则表达式查找和替换Dreamweaver的所有内容 我的CSS: .class1{ position:relative; float:left; margin: 2px 1px 0px 0px; } .class2{ position:relative float:left; margin: 0px 1px 0px 0px; } 现在我想使用正则表达式查找所有边距,并希望通过添加来替换它们!最后一点很重要 我已经可以找到使用正则表达式的方法了

您好,我正在尝试使用正则表达式查找和替换Dreamweaver的所有内容

我的CSS:

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

.class2{
  position:relative
  float:left;
  margin: 0px 1px 0px 0px;
}
现在我想使用正则表达式查找所有边距,并希望通过添加来替换它们!最后一点很重要

我已经可以找到使用正则表达式的方法了

margin:.*?;
现在我想用替换所有的边距!在Dreamweaver中使用正则表达式非常重要。 范例


谁能给出解决方案。

在DW CS6中测试

搜索:
margin:(((?:\s*\d+px)+)\s*

替换:
margin:$1!重要的


我把正则表达式做得有点特殊,所以我们不添加
!重要信息
当我们已有
时!重要信息
:)

是的,它对我有用。非常感谢您的精彩回答。@wahid很高兴它奏效,谢谢您让我知道。
margin: 0px 1px 0px 0px !important;