我遇到了一些正则表达式问题。
使用 gulp-uncss
我想向忽略选项添加一些类。
任何以 .no- 开头的类
任何包含 .is- 的类
.no-flexbox {}
.test.is-active {}
.test .is-hidden {}
.pipe(uncss({
html: ['tmp/public_html/*.html'],
ignore: ['/(.is-)(\w)*', '(.no-)(\w)*']
}))
这不太正确
最佳答案
您的正则表达式看起来不完整。也许你应该这样做
.pipe(uncss({
html: ['tmp/public_html/*.html'],
ignore: ['/\.no-\w+/g', '/\.\w+\s?\.is-\w+/g']
}))
关于javascript - uncss,.no -'string' 和 .is -'string' 的正则表达式模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36358172/