Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2014
    Posts
    1

    Default "Text replacements" with regular expressions?

    Can this tool use a regular expression syntax?
    I often use beyond compare for log files. One side is the log of a feature working, the other side is the feature with some error messages.

    I need to ignore all timestamps for this. It seems "Text replacements" could be used for that, but only if it supports some kind of regular expressions syntax?

    I am currently on version 2, via corporate site license, but thinking of buying my own BC4 license if it has this feature.

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,952

    Default

    Hello,

    For Text Replacements, the "Text to Find" can use Regular Expressions but the "Replace With" has a limited subset (mostly Tagged Expression references). You can use the dropdown arrow next to each textbox to see the the selection of RegEx available.

    In general, this means we can 'Find' the text using a generic mask, but the 'Replace With' must explicitly define the different text.
    Aaron P Scooter Software

  3. #3
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,952

    Default

    I should add you can test this with either the BC3 trial or BC4 beta. Both can run in Pro mode (Help menu -> About dialog; checkbox for Pro features).
    Aaron P Scooter Software

  4. #4
    Join Date
    Oct 2007
    Location
    pittsburgh, PA
    Posts
    64

    Default

    I do this type of comparison occasionally, and since timestamps usually have a consistent format, I use a regular expression to define that format as an unimportant grammar element.

  5. #5
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,952

    Default

    Yes, if this type of difference can simply be ignored (regardless of what it is aligned to) you could define an Unimportant text in the BC2 Rules to match on the timestamp and ignore it.
    Aaron P Scooter Software

  6. #6
    Join Date
    Oct 2007
    Location
    pittsburgh, PA
    Posts
    64

    Default

    It helps that timestamps are usually the first thing in a line, so you can start your regex with "^" and avoid false matches in the middle of a line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •