Apply RegExp.exec recursively