Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<="ref":"refs\/heads\/).+?(?=")
/
g
Input 1
Array ( [payload] => {"ref":"refs/heads/testing","before":"fa65fe4ec197943c7f3d88159d404ed1346259de","after":"e751fcff69075d9775640597aa893055751e587d","created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/T99-/t99.io/compare/fa65fe4ec197...e751fcff6907","commits":[{"id":"e751fcff69075d9775640597aa893055751e587d","tree_id":"c9fc033293392e31957a52c88e9eae207ec2787b","distinct":true,"message":"Testing webhooks #3","timestamp":"2017-07-28T15:46:07-04:00","url":"https://github.com/T99-/t99.io/commit/e751fcff69075d9775640597aa893055751e587d","author":{"name":"Trevor Sears","email":"trevorsears.main@gmail.com","username":"T99-"},"committer":{"name":"Trevor Sears","email":"trevorsears.main@gmail.com","username":"T99-"},"added":[],"removed":[],"modified":["index.html"]}],"head_commit":{"id":"e751fcff69075d9775640597aa893055751e587d","tree_id":"c9fc033293392e31957a52c88e9eae207ec2787b","distinct":true,"message":"Testing webhooks #3","timestamp":"2017-0
Extraction
Array ( [payload] => {"ref":"refs/heads/testing","before":"fa65fe4ec197943c7f3d88159d404ed1346259de","after":"e751fcff69075d9775640597aa893055751e587d","created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/T99-/t99.io/compare/fa65fe4ec197...e751fcff6907","commits":[{"id":"e751fcff69075d9775640597aa893055751e587d","tree_id":"c9fc033293392e31957a52c88e9eae207ec2787b","distinct":true,"message":"Testing webhooks #3","timestamp":"2017-07-28T15:46:07-04:00","url":"https://github.com/T99-/t99.io/commit/e751fcff69075d9775640597aa893055751e587d","author":{"name":"Trevor Sears","email":"trevorsears.main@gmail.com","username":"T99-"},"committer":{"name":"Trevor Sears","email":"trevorsears.main@gmail.com","username":"T99-"},"added":[],"removed":[],"modified":["index.html"]}],"head_commit":{"id":"e751fcff69075d9775640597aa893055751e587d","tree_id":"c9fc033293392e31957a52c88e9eae207ec2787b","distinct":true,"message":"Testing webhooks #3","timestamp":"2017-0