Isolate try catch so V8 can optimize `scanRegExp`.