• Login
Community
  • Login

FunctionList.xml how to ignore wrong syntax.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 1.2k Views
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.
  • S
    Shin Jaeyong
    last edited by Mar 22, 2018, 7:36 AM

    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
    • M
      MAPJe71
      last edited by Mar 22, 2018, 2:47 PM

      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
      • S
        Shin Jaeyong
        last edited by Mar 23, 2018, 4:17 AM

        thanks for your help.
        i works well~ :)

        1 Reply Last reply Reply Quote 0
        3 out of 3
        • First post
          3/3
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors