added regex for getting device_code from json