我使用git与–color-words来查看我的差异.在我的差异中,它显示我删除了
<b>{{ljcount}}</b> Changes
而且我补充说:
<b>{{skills_limits}}</b> 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:]]'