2016-04-01 9 views
0

私はいくつかの正規表現の不具合を抱えています。一息-uncssuncss、.no-'string '、.is-'string'の正規表現パターン

を使用して

私は無視するオプションをいくつかのクラスを追加したいと思います。

.is-

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


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

を含むすべてのクラスは、これは

答えて

1

あなたの正規表現が不完全で見て非常に適切ではありません.no-

で始まる任意のクラス。このようにする必要があります

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

パーフェクト...周囲のアポストロフィを削除しました。 – magicspon