Define Unimportant Text in Beyond Compare

BC3 logo BC version 3 and 4

videoDefining Unimportant Text (3:58)

To ignore text differences, define a new Grammar element (what the text is), then mark it as unimportant.

First, go to Tools | File Formats.  Make a new File Format, or edit an existing Format.

Go to the Grammar tab.  Add a new element and give it a new name (eg. "VarString").  It is important to change this from "New Element" since all New Elements across all file formats will be treated similarly by the Session Settings.  If you compare a Java file to a C++ file, and mark Strings as unimportant, then both Java strings and C++ strings will be marked as unimportant.

Define the element type:

  • Basic:  Match on a specific section of text.  Can be represented as a regular expression.
  • Delimited:  Match on a beginning point of text and an end point of text.  Can stop at end of line.
  • List:  A list of basic matches.  Can be used instead of individual Basic elements.
  • Columns:  A text section defined at a numerical beginning position in a line and an end position.
  • Lines:  Match a beginning point of text or the first line and end a user-defined number of lines down.

Then open your pair of files in a Text Compare session.  Navigate to the Session | Session Settings | Importance tab.  Checked Items are important.  Unchecked items are unimportant.  Uncheck your new element's name (eg. "VarString").

If you want the importance settings to affect all comparisons instead of just the current comparison, change the dropdown at the bottom of the dialog from Use for this view only to Update session defaults before you click OK.

Differences that match your element's definition will now be colored as unimportant differences.  Use the View | Ignore Unimportant Differences command to cause these differences to be treated as matching text.

Copyright © 2023 Scooter Software, Inc.