"Text replacements" with regular expressions?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • regeter
    New User
    • Mar 2014
    • 1

    "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.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    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

    Comment

    • Aaron
      Team Scooter
      • Oct 2007
      • 16000

      #3
      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

      Comment

      • tlscales
        Expert
        • Oct 2007
        • 74

        #4
        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.

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 16000

          #5
          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

          Comment

          • tlscales
            Expert
            • Oct 2007
            • 74

            #6
            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.

            Comment

            Working...