Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

MobaXterm Regular Expression

Guys can you help me to convert this to regular expression using the MobaXterm ##TST:20240314:194836:000015.111:z26841E731BCCBAC926/0:110:100:0:JONG->MPAKLE:8.550:682:896194300:9/11:NP:NP:Response timed out, hostname (MPAK)!

Comments

  • My ChatGPT o3 said:

    Below is a regular-expression “template” that matches lines formatted like the sample you provided.

    ^##TST:
    (?<date>\d{8}):                    # yyyymmdd
    (?<time>\d{6}):                    # hhmmss
    (?<milliseconds>\d{6}\.\d{3}):     # 6-digit seq ‘.’ 3-digit millis
    (?<hex>[A-F0-9]{12})\/             # 12-char hex then “/”
    (?<flag1>\d+):
    (?<flag2>\d+):
    (?<flag3>\d+):
    (?<src>[A-Z]+)->(?<dst>[A-Z]+):
    (?<dur>\d+\.\d+):
    (?<len>\d+):
    (?<sess>\d+):
    (?<code>\d+\/\d+):
    (?<stat1>[A-Z]+):
    (?<stat2>[A-Z]+):
    (?<msg>.+)$
    

    Explanation of the named capture groups:

    Group Field captured Example value
    date Test date (YYYYMMDD) 20240314
    time Test time (HHMMSS) 194836
    milliseconds Sequence + milliseconds 000015.111
    hex Hardware/trace ID z26841E731BCCBAC926 (converted above to 12-hex-char section)
    flag1-flag3 Numeric flags 0 110 100
    src / dst Source → Destination codes JONG → MPAKLE
    dur Duration (seconds) 8.550
    len Bytes/packets length 682
    sess Session/connection ID 896194300
    code Result code 9/11
    stat1 / stat2 Status tokens NP NP
    msg Free-text message Response timed out, hostname (MPAK)!

    You can adjust individual pieces (e.g., allow lower-case letters in src/dst, change numeric ranges, or drop the named-group syntax if your flavor of regex lacks that feature).

  • from chatgpt not working.

Sign In or Register to comment.