$re = '/!1s(?<id>[^!]+).+!3d(?<latitude>[^!]+)!4d(?<longitude>[^!]+)/m';
$str = '/data=!4m7!3m6!1s0x54905cd11489942f:0x6a68c79cf58b8d9!8m2!3d47.4556324!4d-122.2566178!16s%2Fg%2F1tvtb18c!19sChIJL5SJFNFckFQR2bhYz3mMpgY?authuser=0&hl=en&rclk=1
/data=!4m7!3m6!1s0x54906acdccf44db1:0x6da0c1f2d7a6736e!8m2!3d47.61404!4d-122.3281!16s%2Fg%2F11b6hykyrc!19sChIJsU30zM1qkFQRbnOm1_LBoG0?authuser=0&hl=en&rclk=1';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php