Announcement

Collapse
No announcement yet.

How to ignore certain text? Clueless on regex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to ignore certain text? Clueless on regex

    I back up my Chrome preferences file daily and theirs tons and tons of unimportant data I would like to start ignoring.

    I've gone through the help and settings but having a real hard time understanding how to do it. If someone would be so kind to give me a real working example on how to ignore some of this, I could probably figure out the rest.

    Here's an example report.

    Thanks

  • #2
    Hello,

    We have a KB article and video detailing how to define Unimportance here:
    http://www.scootersoftware.com/suppo..._unimportantv3

    Once you have that working for a single pair of files, we can also apply these types of rules to the Folder View, to scan and let you know if the file(s) contain only unimportant text on the folder level.

    Let us know if you have any questions.
    Aaron P Scooter Software

    Comment


    • #3
      OK. Thanks but like I said, I'm clueless when it comes to regex and that video shows a guy adding a regex entry that just looks like gobbledygook to me. I could use a real working example on the specific files I'm trying to compare.

      I had linked to a pastebin with a difference report but it's not in my original post anymore. Here it is in image format. Warning! It's 5000 px tall.

      Comment


      • #4
        Sure, we can help with that. Which lines were you trying to ignore? Anything with "LastPingDay"?

        That would be something like:
        Code:
        ^\s*\"lastpingday.*
        Where:
        ^ is the start of the line
        \s* is 0 or more whitespaces from the start of the line
        \" is the " character
        lastpingday is the text
        .* is everything else that might happen after that.

        If a line then matches this definition, it could be marked as unimportant.
        Aaron P Scooter Software

        Comment


        • #5
          Yeah, last ping and all the other stuff in the image.
          I tried what you suggested but unfortunately it had no effect.

          Comment


          • #6
            Once the grammar is defined, you then need to go to the Session menu -> Session Settings, Importance tab and uncheck the item. Does this get it working?

            If so, in that case, go to the Home screen, in the saved sessions list, expand the Edit session defaults folder, select Text Compare, and uncheck 'last ping time' grammar here as well. Then save to update the default session for future comparisons.

            If you need every line of that report to be ignored, what criteria determines when something is or isn't important? We would need logical rules for the specific text that either:
            should be important, and we can then mark everything else as unimportant
            or
            should be unimportant
            Aaron P Scooter Software

            Comment


            • #7
              Sorry. I missed the part about unchecking the grammar item.
              I just starting to add the unimportant lines and it's working fine now. Thanks!

              Is there a way to define a section of a file? For example, looking at my image, on line #4624 it contains "invalidator": {. This section of the JSON file ends on line #4785 but can grow and contract and also move its location up and down the file.

              Comment


              • #8
                Hello,

                In the KB article above, we have a 'Delimited' grammar type, which can begin at a point (invalidator: {) and go to another point. What would be the end logic it would need, or character it should interpret as the end character?
                Aaron P Scooter Software

                Comment


                • #9
                  Well the ending character repeats itself throughout the JSON file. It's your typical JSON section end...
                  Code:
                      },
                  I'd like to ignore the following sections. This is how they are. They follow one another as shown.

                  Code:
                     "invalidator": {
                        "client_id": "Q2KrlBe3Jb8IMMjJY4VzOA==",
                        "invalidation_state": "CicKJQoGCgQIAxABEhIJe3jRiurHKIYRDkXeOtH/5PIaBwiCLBADGAsSFE9B+utOsQGt5862mCgRHcDEynO/",
                        "saved_invalidations": [ {
                           "invalidation-list": [  ],
                           "name": "APP",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "APP_SETTING",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "AUTOFILL",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "AUTOFILL_PROFILE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "BOOKMARK",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "DEVICE_INFO",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "DICTIONARY",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "EXPERIMENTS",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "EXTENSION",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "EXTENSION_SETTING",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "FAVICON_IMAGE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "FAVICON_TRACKING",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "HISTORY_DELETE_DIRECTIVE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "MANAGED_USER",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "MANAGED_USER_SHARED_SETTING",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "NIGORI",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "PASSWORD",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "PREFERENCE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "PRIORITY_PREFERENCE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "SEARCH_ENGINE",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "SESSION",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "SYNCED_NOTIFICATION",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "THEME",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "TYPED_URL",
                           "source": "1004"
                        }, {
                           "invalidation-list": [  ],
                           "name": "U/pafkbggdmjlpgkdkcbjmhmfcdpncadgh/0",
                           "source": "1030"
                        }, {
                           "invalidation-list": [  ],
                           "name": "U/pafkbggdmjlpgkdkcbjmhmfcdpncadgh/1",
                           "source": "1030"
                        }, {
                           "invalidation-list": [  ],
                           "name": "U/pafkbggdmjlpgkdkcbjmhmfcdpncadgh/2",
                           "source": "1030"
                        }, {
                           "invalidation-list": [  ],
                           "name": "U/pafkbggdmjlpgkdkcbjmhmfcdpncadgh/3",
                           "source": "1030"
                        } ]
                     },
                     "media": {
                        "device_id_salt": "1lxpXGsIw69y7TyPaykZbw=="
                     },
                     "net": {
                        "http_server_properties": {
                           "servers": {
                              "accounts.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "api.zenguard.biz:443": {
                                 "supports_spdy": true
                              },
                              "api.zenmate.com:443": {
                                 "supports_spdy": true
                              },
                              "apis.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "cdn.syndication.twimg.com:443": {
                                 "supports_spdy": true
                              },
                              "ch14.zenguard.org:443": {
                                 "supports_spdy": true
                              },
                              "chatenabled.mail.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 10,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "ci6.googleusercontent.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "clients1.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "clients2.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 15,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "clients2.googleusercontent.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 71,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "clients4.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "clients6.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "encrypted-tbn3.gstatic.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "fbcdn-profile-a.akamaihd.net:443": {
                                 "settings": {
                                    "4": 20,
                                    "7": 65536
                                 },
                                 "supports_spdy": true
                              },
                              "fonts.googleapis.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "i1.ytimg.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 18,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                              "id.google.com:443": {
                                 "alternate_protocol": {
                                    "port": 443,
                                    "protocol_str": "quic"
                                 },
                                 "settings": {
                                    "4": 100,
                                    "5": 32,
                                    "6": 0
                                 },
                                 "supports_spdy": true
                              },
                           "version": 2
                        }
                     },
                  Right before the above 3 sections is this...
                  Code:
                     "invalidation_service": {
                        "use_gcm_channel": false
                     },
                  And right after is this...
                  Code:
                     "ntp": {
                        "app_page_names": [ "Apps", "Apps" ]
                     },
                  I'm also having another issue. When I ignore the lines like you showed me, I wind up with stray section ends. I can't ignore those lines because they are everywhere. See pic...

                  Any hints?
                  EDIT: Oh. I remember seeing something about ignoring adjacent lines. Gonna have a look.
                  Last edited by brooket; 02-Jul-2014, 12:42 PM.

                  Comment


                  • #10
                    We would likely need sample files with a couple of explicit line number cases to help define. I notice your screenshot has several "}," that occur, but no leading "{", but I cannot see to the right to see if they are 'off screen(shot)'.

                    You can email us at [email protected] with a link back to this forum post for our reference.
                    Aaron P Scooter Software

                    Comment


                    • #11
                      Thanks Aaron. I've but this on the backburner but am having success with the adjacent lines trick. I think I'll be able to accomplish what I want once I finish setting up the rules. Thanks a lot for the bit of regex. That stuff makes my head spin and what you posted worked perfect for identifying the lines.

                      Comment


                      • #12
                        Hello,

                        I would also need some help with REGEX expression for the below lines to ignore the entire block

                        Code:
                        Output Directory (SQOT): /home/abcde1/dir1/dir2/dir3/log_output/filename_1111111
                        Log Directory (SQLG): /home/abcde1/dir1/dir2/dir3/log_output/filename_1111111
                        
                        Log File (SQLF): /home/abcde1/dir1/dir2/dir3/log_output/filename_1111111/filenamea_123.out
                        Include File (SQIN): /home/abcde1/dir1/dir2/dir3/log_output/filename_1111111/,/home/abcde1/sqr/,/home/abcde1/sqr/,/,/
                        File (FILE_1): /home/abcde1/dir1/dir2/dir3/log_output/filename_1111111/filenamea_123.PDF
                        I tried to put the REGEX expression as below for each line but seems like not working for me.

                        Code:
                        Output Directory (SQOT):\s/home/.*_\d{7}
                        Log Directory (SQLG):\s/home/.*_\d{7}
                        Log File (SQLF):\s/home/.*.out
                        Include File (SQIN):\s/home/.*,/
                        File (FILE_1):\s/home/.*.PDF
                        Please advise if the expressions are correct or they need to be updated. Thanks

                        Comment


                        • #13
                          Hello,

                          The main issue with your RegEx is that your text (SQOT) was not escaped (and the () are used as RegEx). Add \( and \) to use the literal characters.

                          My suggestion for troubleshooting this is to break the expression slowly from left to right.
                          Output Directory \(SQOT\)
                          which would set just that part of the line as Unimportant (and you can verify that section works). Then add part by part to verify the built regex step by step.
                          Output Directory \(SQOT\):
                          Output Directory \(SQOT\):\s/home
                          Output Directory \(SQOT\):\s/home/.*_\d{7}
                          until finally we can confirm the entire line is now defined. You can click the blinking cursor into the text, and the bottom status bar will display the grammar element name. Or if you've defined it as Unimportant, it'll show a growing Unimportant part of the line.

                          In your specific examples above, I could get them working just by fixing \( and \), but I've found the slow build method useful when creating complex RegExs.
                          Aaron P Scooter Software

                          Comment


                          • #14
                            Thanks!

                            Adding \( and \) has worked for me --> Output Directory \(SQOT\)

                            Comment

                            Working...
                            X