Regular Expressions 101

Community Library

Community Library Entry

0

Regular ExpressionOpen Workspace

"
(?:\"(?:errorType)\"(?:[^:])*):(?:(?:[^\",])*)\"([^\"]*)
"
g

Description
Created·2022-11-26 18:23
Updated·2022-11-26 21:13
Type·Match
Flavor·Java

Sample:

Finds errorType key values from a json. Values are returned in capturing group 1 of each match. Both UNKNOWN and UNAUTHENTICATED will be captured.

 {
  "data": null,
  "errors": [
    {
      "message": "Message",
      "extensions": {
        "errorType": "UNKNOWN",
        "error_code": "AUTHENTICATE_USER_FALSE"
      }
    },
    {
      "message": "Message",
      "extensions": {
        "errorType": "UNAUTHENTICATED",
        "error_code": "AUTHENTICATE_USER_FALSE"
      }
    }
  ]
}
Submitted by amansaryal
Open Workspace