Home >  Products >  Compare It! 3 >  Online Help
Welcome to Compare It!
About Compare It!
Installing and Removing Compare It!
What's New in This release?
Quick Start
User Interface Basics
Application Window Illustration
Using Compare It!
Comparing files
Merging Files
Editing Files
Setting Options
General
File Filters
Comparison
Advanced Comparison
Editor
Colors
Language
Keyboard
Converters
Viewers
Printing and Reporting
Print options
Print Options: Margins
Print Options: Advanced
Comparison report
Comparison statistics
Keyboard Shortcuts, Toolbar Buttons, Menu Commands
Advanced Functions
Adding Shortcuts to External Applications
Adaptive comparison
Auto Backup
Automatch rules
Command Line Usage
Configuration File
Changes Only Mode
Custom Syntax Files
Defining Column Ranges
Enhanced Open File
File lists support
Folders comparison
Ignore Difference
Manual Matching
Merged Report
Moved Sections
Partial matching
Profiles
Result File Support
Separate
Unicode Support
Using Compare It! with File Manager
Using fixed/alternative font
Using Regular Expressions
Using RegExps substrings
Word files comparison
Excel files comparison
Other file formats support
Zip File Support
General Information
What is Shareware?
How To Register
Warranty and License
Future Releases
Other Products
Frequently Asked Questions
Updates and Support
Regular expressions Dialog Box

Compare It! can use regular expressions (RE) to ignore some parts of text strings. For example, using regular expressions, you can define rules to ignore the first 10 characters or line numbers, if they are included. Compare It! will search for defined regular expression text and replace it with other text. Note that this operation will not change your file, it will only affect internal text used for the comparison.

See Using Regular Expressions for additional information about regular expressions.

How RE can affect comparison.


RE can be applied by several rules:

  • Replace - simple search and replace is done;
  • Ignore string with match - whenever match will be found in string, full string will be ignored during comparison;
  • Cut file after match - whenever match is found in line, file loading is stopped. Note that unlike other methods, this will affect how document will look on the screen.
  • Ignore lines between R1 and R2 - file is processed normally until string matching R1 (search RE) is found. Then all strings are ignored, while line matching R2 (replace RE) is not encountered
  • Ignore lines matching R2 after R1 - file is processed normally until string matching R1 (search RE) is found. Then all consecutive strings, matching R2 (replace RE), will be ignored. Line that doesn't match R2 will stop the rule.
  • Ignore lines not matching R1 - only lines, matching search RE, will be used for comparison; all other lines will be ignored. This rule is opposite to Ignore string with match
  • Automatch rule - unlike other actions, this one can be used to visually align lines automatically by selected keywords. See details.
You can select desired rule while creating regular expression.

To define a regular expression

  1. Choose Options > Options.
    The Options dialog box appears.
  2. In the Options box, click Comparison.
  3. Select the Use Regular Expressions check box and click the browse (...) button next to the check box.
    The Regular expressions dialog box appears.
  4. In the Items box, click  Add regular expression.
  5. In the Name field, type a name for the regular expression.
  6. In the Search field, define a regular expression to find in every text line in the file.
    Note: The background color of this field will change to red if your regular expression is not formed correctly.
  7. In the Replace field, define the text to replace the found sub-string.
    You can also leave this field empty to simply remove the matching sub-string.
  8. In the Files field, enter a file mask to use for the regular expression.
    You can also use the select button (>>) to select from predefined file types.
  9. Select the Use only once check box to apply the regular expression rule only once to each string. This means that after RE is found and replacement is done, string will not be changed by same rule anymore. If this option is not set, string would be searched for next occurence of RE.
    This is important for regular expression rules that replace text at the start of lines.
  10. Finally, set appropriate replace action for RE - this will affect how it will be used during comparison. See actions description above
  11. Click the Close button.
    Note: If regular expressions were applied to the file, Regular expression applied to file appears at the right in the title bar of the source or target pane.

To remove a regular expression

  1. Choose Options > Options.
    The Options dialog box appears.
  2. In the Options box, click Comparison.
  3. Select the Use Regular Expressions check box and click the browse (...) button next to the check box.
    The Regular expressions dialog box appears.
  4. In the Items box, select the name of the regular expression to remove and click  Remove regular expression.
  5. In the Name field, type a name for the regular expression.
  6. Click the Close button.

Once you have defined regular expressions, you can enable or disable them for specific comparisons.

To enable or disable a regular expression

  1. Choose Options > Options.
    The Options dialog box appears.
  2. In the Options box, click Comparison.
  3. Select the Use Regular Expressions check box and click the browse (...) button next to the check box.
    The Regular expressions dialog box appears.
  4. In the Items box, select the name of the regular expression to enable or disable and click the appropriate check box  Enable or disable regularexpression  at the bottom of the dialog box: click the selected check box to enable the regular expression, or click the clear check box to disable the regular expression.
  5. Click the Close button.

© 1996-2009, Grig Software, All Rights Reserved
Browser Based Help. Published by chm2web software.