Announcement

Collapse
No announcement yet.

Ignore Differences in Syntax in Beyond Compare

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ignore Differences in Syntax in Beyond Compare

    Please answer this question http://stackoverflow.com/questions/1...-beyondcompare

    In a branch of code I have changed all of the code from obj.varname to obj("varname") and when I compare the code I would like to ignore these differences since varname is the same.

    I have a regular expression that I think I need but unfortunately can't get the comparison to be ignored using Beyond Compare from Scooter

    ^obj\("\w*"\)|obj\.\w*$

    I am following this tutorial http://www.scootersoftware.com/suppo..._unimportantv3

    So my question: is this even possible with beyond compare? If yes, please share a solution including either instructions or post your screenshots.

  • #2
    Hello,

    Unimportance would require two definitions, and would mark both obj.varname and obj("varname") as unimportant wherever they appeared in the file (regardless of what they aligned to). The item they aligned to would still be Important/Unimportant depending on its own definition.

    Edit: Make two separate grammar entries with the same "New Element" name. I would suggest some custom name such as "Unimportant method name". Then in the Session Settings, Importance tab, make sure "Unimportant method name" is unchecked.

    The scenario you described is best met by our BC3 Pro feature Text Replacements. If you are registered for BC3 Std, you will need to revert to trial mode to try this out:
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro

    Once done, load your two files in the Text Compare. Given your example, I loaded a file on the left with:
    obj.varname

    and a file on the right with:
    obj("varname")

    Then go to the Session menu -> Session Settings, Replacements tab, and create a New text replacement.

    On the Left I used:
    (\w+)\.(\w+)

    and on the right I used:
    $1("$2")

    and I enabled "Regular expressions".
    Last edited by Aaron; 15-Aug-2012, 12:09 PM. Reason: Edit: remove "|"
    Aaron P Scooter Software

    Comment

    Working...
    X