加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

正则表达式 – Git – 不包括{}

发布时间:2020-12-13 22:54:33 所属栏目:百科 来源:网络整理
导读:我使用git与–color-words来查看我的差异.在我的差异中,它显示我删除了 b{{ljcount}}/bnbsp;nbsp;nbsp;Changes 而且我补充说: b{{skills_limits}}/bnbsp;nbsp;nbsp;Changes 这比我想要的要大(我想要的边界在{}).我试着用–word-diff-regex来玩,但是找不到正
我使用git与–color-words来查看我的差异.在我的差异中,它显示我删除了
<b>{{ljcount}}</b>&nbsp;&nbsp;&nbsp;Changes

而且我补充说:

<b>{{skills_limits}}</b>&nbsp;&nbsp;&nbsp;Changes

这比我想要的要大(我想要的边界在{}).我试着用–word-diff-regex来玩,但是找不到正则表达式来使它工作.如何达到这个结果?

从git帮助差异:
--word-diff-regex=<regex>
       Use <regex> to decide what a word is,instead of considering runs of non-whitespace to be a word. Also implies
       --word-diff unless it was already enabled.

以下表达式将使单词成为任何字符串和下划线,或任何非空格字符.

$git diff --color-words --word-diff-regex='w+|[^[:space:]]'

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读