Dreamweaver 使用的是 Javascript Regex 风格。
找到 1:
([ \t]*)(background:\s*-webkit-linear-gradient\(top\s*,\s*(#[a-fA-F0-9]{3,6})\s*,\s*(#[a-fA-F0-9]{3,6})\s*\)\s*;)
// assuming these are hexadecimal colors like you indicated with #
替换1:
$1background: -ms-linear-gradient(top, $3, $4);
$1$2
找到 2:
([ \t]*)(box-shadow:\s*([^;]+)\s*;)
替换2:
$1-webkit-box-shadow: $3;
$1$2
第一个查找模式的解释:
所有空格字符\s都是可选的(感谢*)。此外,文字括号被转义。在替换中$1,$2等表示[capturingGroup n]。
( # capturing group #1
[ \t]* # 0 or more spaces and/or tabs (could be any number of both)
)
( # capturing group #2
background:\s*-webkit-linear-gradient\(top\s*,\s*
( # capturing group #3
#[a-fA-F0-9]{3,6} # a number sign and a string with 3 or 6 digits that's made of a-zA-Z0-9 (aka. hexadecimal characters)
)
\s*,\s*
( # capturing group #4
#[a-fA-F0-9]{3,6}
)
\s*\)\s*;
)