Go Back   Scooter Forums > Beyond Compare 3 Discussion > Text Compare (2-way)
Register FAQ Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 15-Aug-2012, 08:20 AM
kiev123 kiev123 is offline
Visitor
 
Join Date: Jun 2012
Posts: 3
Default 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.
Reply With Quote
  #2  
Old 15-Aug-2012, 10:06 AM
Aaron Aaron is online now
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,428
Default

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".
__________________
Aaron P Scooter Software

Last edited by Aaron; 15-Aug-2012 at 10:09 AM. Reason: Edit: remove "|"
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:02 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.