Ignore Grammar Rule for LOG: Tick(ms)=NNNN ???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AChimpNamedCornelius
    Journeyman
    • Dec 2011
    • 12

    Ignore Grammar Rule for LOG: Tick(ms)=NNNN ???

    I am pulling my hair out trying to format a rule to ignore time stamps of this format:

    LOG: Tick(ms)=NNNN: And other text out here that I do want to diff.


    Where everything is text except the NNNN which are digits. This can increase beyond 4 digits, and actually less than 4 for that matter.

    The problem, I think, is that so much may have to be escaped, and I am running out of permutations to try.

    This fails, as do many other things.
    LOG: Tick\(ms\)=(\d\d\d\d)

    Please, sirs and madames?
  • Aaron
    Team Scooter
    • Oct 2007
    • 16008

    #2
    Hello,

    How does this RegEx work for you:
    LOG\: Tick\(ms\)=\d+



    And here is the general KB article to help create a grammar element, mark it Blue/Unimportant, then enable Ignore Unimportant Differences to hide blue text as black text:
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment

    • AChimpNamedCornelius
      Journeyman
      • Dec 2011
      • 12

      #3
      LOG\: Tick\(ms\)=\d+

      Doesn't work unfortunately. I also tried escaping the parens around the ms, and all permutations of escaping the colon and equals sign just in case (though the help link from within BeyondCompare does not list either as special characters for their regular expression.)

      Maybe there are strange whitespace chars? Shouldn't be as these are just printfs from a C program.


      Logically this should work, but does not (at least for 4 Ns):
      LOG: Tick\(ms\)=\(\d\d\d\d\)

      Nor this if colon needs escaping:
      LOG\: Tick\(ms\)=\(\d\d\d\d\)

      Comment

      • Chris
        Team Scooter
        • Oct 2007
        • 5538

        #4
        I don't think the colon needs to be escaped.

        The following regular expression should work:

        LOG: Tick\(ms\)=\d+

        To verify the expression is matching, cursor into the text. It will display the name of the current grammar element type in the status bar at the bottom of the Text Compare window.
        Chris K Scooter Software

        Comment

        • AChimpNamedCornelius
          Journeyman
          • Dec 2011
          • 12

          #5
          Originally posted by Chris
          I don't think the colon needs to be escaped.

          The following regular expression should work:

          LOG: Tick\(ms\)=\d+

          To verify the expression is matching, cursor into the text. It will display the name of the current grammar element type in the status bar at the bottom of the Text Compare window.

          OH MY GOD, this and (the correct one) of my own creations worked. The problem? UNCHECK the ones you want to activate in the Session Settings, Importance tab!!!!!!!!!!!!!!!

          UNCHECK

          Oh.
          My.
          God.


          I even had this in a note to myself explaining step-by-step how to do this the first time I did it months ago. (As an aside, why would you uncheck the ones you wanted active? The point is to ignore certain patterns! Ehh, been programming 30 years, it's probably that's just what the guy felt when he got outta bed that morning.)
          Last edited by AChimpNamedCornelius; 30-Jul-2015, 11:43 AM.

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16008

            #6
            The Importance tabs lists all grammar items (and items not covered by grammars as Default text). Checked items are Important, while Unchecked items are Unimportant.

            BC4 also adds an "Unimportant" block where you can create quick adhoc rules in this tab for just the current view.

            Glad it's working well for you now.
            Aaron P Scooter Software

            Comment

            Working...