How do I configure BeyondCompare to ignore SCM replaced text in comments?

后端 未结 2 608
忘了有多久
忘了有多久 2021-02-07 05:10

I do have some text sequences that are replaced by the SCM (Perforce in my case).

I do want to configure BeyondCompare to consider these sequences as unimportant differe

2条回答
  •  后悔当初
    2021-02-07 06:01

    You need to define a new grammar element (let's call it "SCM") and mark it as unimportant (see the tutorial here; choose "Basic" and make sure to check "Regular Expression").

    The grammar element should be (if I interpret your examples correctly):

    ^.*\$(Id|DateTime|Author|Change):.*$
    

    This will ignore any line that contains $Id:, $DateTime: etc.

    If you only want to ignore lines that start with # $..., use

    ^\s*#s*\$(Id|DateTime|Author|Change):.*$
    

    And if you only want to ignore stuff between $ (and treat everything else as important), use

    \$[^$\r\n]*\$
    

    or

    \$(Id|DateTime|Author|Change)[^$\r\n]*\$
    

    depending on whether you care about those keywords or not.

提交回复
热议问题