Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    8

    Default 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?

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

    Default

    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

  3. #3
    Join Date
    Dec 2011
    Posts
    8

    Default

    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\)

  4. #4
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,728

    Default

    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

  5. #5
    Join Date
    Dec 2011
    Posts
    8

    Default

    Quote Originally Posted by Chris View Post
    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 at 10:43 AM.

  6. #6
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,893

    Default

    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

Posting Permissions

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