CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2008
    Posts
    111

    Question Pattern and picking out needed values using Regex with Java

    I am terrible at trying to figure out this Regex! It's, like everyone else, doesn't make much since.
    The string looks like this:
    Code:
    15:26:04,017 INFO [stdout] (Log4j2-xxxxxxxxx-1) 2019-04-23 15:26:03,945 [ http-xxxxxxxxx-4] [ STANDARD] [ ] [ xxxxxxxxx:8] (rnal.loaders.xxxxxxxxx) INFO xxxxxxxxx.xxxxxxxxx.xxxxxxxxx.xxxxxxxxx|1xxxxxxxxx4|Rest|SystemManagement|v2|importxxxxxxxxxd1070581a|xxxxxxxxxPSUYP7A - The import WORK- PxxxxxxxxxWARNING #xxxxxxxxx.591 GMT
    The pattern looks like this when breaking the above up:
    Code:
    15:26:04
    017
    INFO 
    stdout
    Log4j2-xxxxxxxxx-1
    2019-04-23 
    15:26:03
    http-xxxxxxxxx-4
    STANDARD
    [] 
    [xxxxxxxxx:8] 
    rnal.loaders.xxxxxxxxx
    INFO
    xxxxxxxxx.xxxxxxxxx.xxxxxxxxx.xxxxxxxxx
    1xxxxxxxxx4
    Rest
    SystemManagement
    v2
    importxxxxxxxxxd1070581a
    xxxxxxxxxPSUYP7A 
    The import WORK- PxxxxxxxxxWARNING #xxxxxxxxx.591
    GMT
    Any help with this crazy pattern would be great! I've been told that using [.*?] would help with the X in brackets but it's still over my head and I don't know how to go about this the LONG LONG way around (.replace, .contains, .indexOf) but I know using Regex is much cleaner.
    Last edited by StealthRT; April 24th, 2019 at 09:28 AM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured