$re = '/balance\"\:\"([0-9]{1,})\"\,\"settings/';
$str = '[200,{"cookie":"623218:b4693930b241d92abcd866afd3a48090ee213570","user":{"id":"623218","name":"null","email":"knight-war@hotmail.com","api_key":"09cafaaa34299398474bb6bdff7e02a2a7fb6fda","premium":"Thu Oct 09 2014 17:39:15 GMT+0000 (UTC)","premium_unix":"1412876355","webspace":53687091200,"traffic":{"current":1099511627776,"increase":0,"last":1413569003,"max":0},"balance":"0","settings":{},"external_id":"null","ftp_username":"ftp623218","partner":"3","partner_last":"1413025653","allow_dupe_names":"0"},"session":"45af19f7-4d90-40ad-b90e-d98fa22ba15c"}]1';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 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