2016-04-01 33 views
0

我有一些正则表达式的困扰。uncss,.no-string的正则表达式模式,.is-string'

使用一饮而尽,uncss

我想一些类添加到忽略选项。

与.no-

包含.is-

.no-flexbox {} 
.test.is-active {} 
.test .is-hidden {} 


.pipe(uncss({ 
    html: ['tmp/public_html/*.html'], 
    ignore: ['/(.is-)(\w)*', '(.no-)(\w)*'] 
})) 

这是不完全正确

回答

1

你的正则表达式看起来不完整的任何类开始任何类。可能你应该这样做

.pipe(uncss({ 
    html: ['tmp/public_html/*.html'], 
    ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g'] 
})) 
+0

完美...只是删除了周围的撇号,boooom ...非常感谢 – magicspon