function extractJSON(rawJson) {
  return rawJson
    .replace(/\s*while\((1|true)\)\s*;?/, '')
    .replace(/\s*for\(;;\)\s*;?/, '')
    .replace(/^[^{\[].+\({/, '{')
    .replace(/}\);?\s*$/, '}');
}

module.exports = extractJSON;

function extractJSON(rawJson) {
  return rawJson
    .replace(/\s*while\((1|true)\)\s*;?/, '')
    .replace(/\s*for\(;;\)\s*;?/, '')
    .replace(/^[^{\[].+\({/, '{')
    .replace(/}\s?\);?\s*$/, '}');
}

module.exports = extractJSON;

Fix the regular expression at the end of raw jsonp.
Fix the regular expression at the end of raw jsonp.
