This regex does work for `GETPOST`. You may use the following regex for the whole pattern:

~~~php
preg_match('/^(?:(GET|POST|PUT|DELETE),)*(GET|POST|PUT|DELETE)\s+(.*)$/', $key, $matches);
~~~