Inside my bash script I've created a function that returns the following JSON array:
{
"access_token": "sjdhjdYdjsdbhggjhSJ78dbdsdbMhd=",
"scopes": "repository:delete repository:admin repository:write project:write team:write account:write",
"expires_in": 3600,
"refresh_token": "skdjKJDJDBNBDs",
"token_type": "bearer"
}
Now I wan't to grep the access token between the "". So I got sjdhjdYdjsdbhggjhSJ78dbdsdbMhd=
I've created a regex like below but this returns a grep: invalid repetition count(s)
error.
grep -P '\{\s*"access_token"\s*:\s*(.+?)\s*\"' foobar.txt