Skip to content
Advertisement

Regex make a group optional

I have the below messages to parse

JavaScript

The regex which I have so far is

JavaScript

I am able to match almost everything I except the line

Dispatch Queue size: 2

Looks like the last group in my regex should be optional. I tried using ? but I am unable to figure out the proper syntax.

Can someone please suggest the change that would be help here?

Advertisement

Answer

This should give you the groups:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement