.no-'string',.is-'string'的uncss,regex模式 [英] uncss, regex pattern for .no-'string', .is-'string'

查看:97
本文介绍了.no-'string',.is-'string'的uncss,regex模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一些正则表达式问题.

I'm having some regex woes.

使用gulp-uncss

Using gulp-uncss

我想在忽略选项中添加一些类.

I'd like to add some classes to the ignore option.

任何以.no-开头的类

Any class that starts with .no-

任何包含.is-

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


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

这不太正确

推荐答案

您的正则表达式看起来不完整.也许您应该这样做

Your regexes look incomplete. May be you should do like this

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

这篇关于.no-'string',.is-'string'的uncss,regex模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆