Regex to capture everything after first occurrence of special character for multiple fields

Viewed 24

I am currently running the following regex to capture all field value pairs with in brackets of a message. The following regex will work, except when multiple colons followed by a space are used in a field value, i.e. Field3 in the message below:

\[([^\]]*)\:[\ ]+([^]]*)]

Message being parsed:

Jul 27 03:50:30 HOST02 log-type 2022-07-27T09:50:30 [INFO] [Field1: thread1] [Field 2: default] [Field3: Name of Item:  Using a colon in Name] [Field 4: 36719] [Field5: 2022-07-27T09:00:01] [Field 6: 0:50:28.574] Message string.

Current result:

Field3: Name of Item = "Using a colon in Name"

Desired result:

Field3 = "Name of Item:  Using a colon in Name"
0 Answers
Related