1
(?<selector>[^\{\s]+\w+(\s\[^\{\s]+)?)\s?\{(?<style>[^\}]*)\}
上面幾乎匹配所有情況。有一個正則表達式用於匹配需要調整的CSS
audio:not([controls])
{
display:none
}
然而,像這樣的東西(與方括號),不正確。
button,input[type="button"],input[type="reset"],input[type="submit"]
{
cursor:pointer;-webkit-appearance:button
}
input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button
{
-webkit-appearance:none
}
這些太...
不錯,謝謝 – Matt