Community
    • Login

    FunctionList.xml how to ignore wrong syntax.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Shin JaeyongS Offline
      Shin Jaeyong
      last edited by

      i’ve been making new parser for my logfile.
      but i couldn’t find out a way how to ignore wrong syntax.

      for example,

      [SECTION] part1 {
      SECTION 2018-03-22 THU 13:14:23
      BLA BLA 1234 : DENY
        logloglog

      }

      [SECTION] part2 {
      SECTION 2018-03-22 THU 13:16:23
      BLA BLA 1234 : COMPLD
        logloglog
      }

      [SECTION] part3 {
        logloglog
      SECTION 2018-03-22 THU 13:18:23
      BLA BLA 1234 : DENY
        logloglog

      }

      [SECTION] part4 {
      SECTION 2018-03-22 THU 13:20:23
      }

      [SECTION] part5 {
      }

      [SECTION] part6 {
        logloglog
      SECTION 2018-03-22 THU 13:25:23
      BLA BLA 1234 : COMPLD
        logloglog
      }

      [SECTION] part7 {

      SECTION 2018-03-22 THU 13:30:23
      BLA BLA 1234 : COMPLD
      

      }

      i wand to match part2, part6,part7 by RE.
      (i use prompt name(=SECTION) and date,time and ‘COMPLD’ word.)

      i tested RE at https://regex101.com/

      (?x)
      (?ms)
      ^(?:[(.+)]\s+) part[0-9]+\s{
      \s+
      .?                       # after founding out issue about part6. i added here
      (?:\1)\s+[0-9]{4}-[0-9]{2}-[0-9]{2}\s+(?:SUN|MON|TUE|WED|THU|FRI|SAT)\s+[0-9]{2}:[0-9]{2}:[0-9]{2}
      \s+
      [A-Z0-9]
      \s+:\s+COMPLD
      .*?                       # after founding out issue about part6. i added here
      \s+
      }

      but, i had a problem with ‘part6’.
      so i added ‘.*?’ in the middle.

      however, i think ‘.*?’ is not correct RE

      please, help me to solve this issue.

      1 Reply Last reply Reply Quote 0
      • MAPJe71M Offline
        MAPJe71
        last edited by

        Try this:

        (?x)
        (?ms)
        ^\[(\w+)\]\s+part\d+\s+\{
        [^}]*?
        \1\s+\d{4}-\d{2}-\d{2}\s+(?:SUN|MON|TUE|WED|THU|FRI|SAT)\s+\d{2}:\d{2}:\d{2}
        [^:]+?\s+:\s+COMPLD
        [^}]*?
        \}
        
        1 Reply Last reply Reply Quote 0
        • Shin JaeyongS Offline
          Shin Jaeyong
          last edited by

          thanks for your help.
          i works well~ :)

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors