Optional expressions at end of string?

Comments

2 comments

  • Avatar
    Kevin Keech

    Cory,

    For the option expression in the parse regex you need to supply this within a non-capturing group, for example  (?:string) So just a minor update to your expression should hopefully get your results and remove the error your seeing.

     

    | parse regex "\d{2}:\d{2}:\d{2},\d+(?<level>[A-Z]+)(?<class>[A-Za-z]+):\d+ - (?<message>.*?)(?:\s:\s(?<user\_agent>.*))?$"

     

    0
    Comment actions Permalink
  • Avatar
    Cory Wilkerson

    Thank you!!!

    0
    Comment actions Permalink

Please sign in to leave a comment.