Regular Expressions 101

Community Patterns

Bitbucket OAuth access_token

0

Regular Expression
PCRE (PHP <7.3)

/
(?<=\"access_token\":\s\")[^\"]*
/
g

Description

Grep the access_token from response returned by bitbucket's oauth access_token endpoint. For example:

curl -s https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials -u KEY:SECRET
Submitted by anonymous - 7 years ago