{"ScriptPreparationCode":"var regex = /[Tt]he/g;\r\nvar lastIndex = regex.lastIndex = 0\r\nvar str = \u0022The next administration must \\\u0022restore the rule of law in the national security arena,\\\u0022 end \\\u0022excessive government secrecy\\\u0022 and set aside the \\\u0022claims of unfettered executive power,\\\u0022 Koh told a House panel in 2008.\\nBut as the State Department\\\u0027s legal advisor in that new administration, Koh helped set out a legal justification for policies that include a ramped-up use of unmanned drones to attack and kill suspected terrorists in Pakistan as well as in Yemen and Somalia, far from the combat zone in Afghanistan. Thousands have died, and the targets have included U.S. citizens who were seen as inspiring attacks against Americans.\\nKoh, who is preparing to return to Yale as President Obama\\\u0027s first term comes to an end, has become a symbol of national security policies that many feel are not significantly different than those of Obama\\\u0027s predecessor.\\nKoh has many defenders who say the administration\\\u0027s anti-terrorism policies would have been harsher if he were not there. But the surprising turn has left some liberal critics puzzled. Did Koh change, or is there some \\\u0022deeper pathology\\\u0022 that causes \\\u0022top administration lawyers to rubber stamp power grabs?\\\u0022 Bruce Ackerman, another Yale law professor, wrote in a news blog.\\nObama\\\u0027s team unquestionably made progress on some fronts. The harsh treatment and even torture of prisoners was ended, and several dozen detainees were repatriated to other countries. But Congress blocked plans to close the Guantanamo prison and to prosecute its remaining detainees before civilian judges and juries.\\nThe rhetoric was toned down as well. Officials no longer speak of a \\\u0022global war on terror\\\u0022 or \\\u0022enemy combatants.\\\u0022 They talk instead of applying the \\\u0022rule of law\\\u0022 to cope with new problems.\\nBut Obama\\\u0027s drone policy has caused dismay among many human rights activists. When Koh stepped forward two years ago to offer a legal defense, it had a familiar ring. In wartime and in \\\u0022response to the horrific 9\\x2F11 attacks,\\\u0022 the president \\\u0022may use force consistent with the [nation\\\u0027s] inherent right of self-defense,\\\u0022 Koh told the American Society of International Law.\\nAs legal authority for the president\\\u0027s action, he pointed to the congressional authorization for the use of military force adopted just after the Sept. 11 attacks, the same measure Bush\\\u0027s advisors cited as justification for the Guantanamo detentions. \\\u0022It is the considered view of this administration,\\\u0022 Koh said, \\\u0022that U.S. targeting practices, including lethal operations conducted with the use of unmanned aerial vehicles, comply with all applicable law, including the laws of war.\\\u0022\\nConservative columnists were quick to lampoon Koh for what looked to be an about-face. Where the \\\u0022old Harold Koh\\\u0022 was outraged by imprisoning suspected terrorists, the new Koh could defend the legality of killing them.\\nKoh said he heard the same at cocktail hours at conferences of liberals. \\\u0022I get questions in the following form: \\\u0027You\\\u0027re a hypocrite, aren\\\u0027t you?\\\u0027\\\u0022 he said in a talk to one such group.\\n\\\u0022There was an outpouring of outrage over detainees at Guantanamo, but hardly a peep from foreign governments about the 3,000 reportedly killed by drones in Obama\\\u0027s first term,\\\u0022 said John B. Bellinger III, the State Department legal advisor under Bush. That may change in Obama\\\u0027s second term. Drones could become \\\u0022Obama\\\u0027s Guantanamo,\\\u0022 he said.\\nJohn C. Yoo, the Berkeley law professor who was the focus of ire in the Bush era for the so-called torture memo that justified harsh interrogations, said he found much to like these days.\\n\\\u0022I don\\\u0027t want to speak specifically about Koh\\\u0027s record,\\\u0022 Yoo said. \\\u0022There is no doubt that on issues ranging from drones to military commissions to Guantanamo Bay, Obama and his legal advisors performed a 180-degree turnaround once in office. But the nation\\\u0027s security was better off that they were hypocritical, rather than maintaining a foolish consistency with the immature 2008 campaign views.\\\u0022\\nThe American Civil Liberties Union and the Center for Constitutional Rights have been as vehement in their criticism of the drone strikes as they were of the Guantanamo prison. In July, they filed a suit over the killing of three U.S. citizens, including a 16-year-old boy, in a drone strike in Yemen.\\n\\\u0022When a 16-year-old boy who has never been charged with a crime nor ever alleged to have committed a violent act is blown to pieces by a U.S. missile, alarm bells should go off,\\\u0022 said Pardiss Kebriaei, a lawyer for CCR. \\\u0022The U.S. program of sending drones into countries \\u2026 against which it is not at war and eliminating so-called enemies on the basis of executive memos and conference calls is illegal, out of control and must end.\\\u0022\\nYale has announced that Koh will be back in New Haven, Conn., at the end of January. Some in the legal world will be listening closely to what he has to say once he is out of government.\\n\\\u0022Academics can take strong positions when they are speaking for themselves, but when they go into government, they have to compromise. Koh was asked to join a team,\\\u0022 said University of Chicago law professor Eric Posner. \\\u0022My guess: He believes he has done more good than not. But it will be interesting to hear what he has to say now.\\\u0022\\ndavid.savage@latimes.com\u0022;","TestCases":[{"Name":"exec() clean","Code":"var result = regex.exec(str)\r\nif(result) {\r\n /* do something */\r\n return [result.index, regex.lastIndex]\r\n}\r\n","IsDeferred":false},{"Name":"exec() fair using substring","Code":"var str2 = str.substring(lastIndex)\r\nvar result = regex.exec(str2)\r\nif(result) {\r\n /* do something */\r\n return [result.index, lastIndex = regex.lastIndex]\r\n}\r\nlastIndex = 0\r\n","IsDeferred":false},{"Name":"search() and test() using substring","Code":"var str2 = str.substring(lastIndex)\r\nvar startIndex = str2.search(regex)\r\nif(regex.test(str2)) {\r\n /* do something */\r\n return [startIndex, lastIndex = regex.lastIndex]\r\n}\r\nlastIndex = 0\r\n","IsDeferred":false},{"Name":"search() and test() using substr","Code":"var str2 = str.substr(lastIndex)\r\nvar startIndex = str2.search(regex)\r\nif(regex.test(str2)) {\r\n /* do something */\r\n return [startIndex, lastIndex = regex.lastIndex]\r\n}\r\nlastIndex = 0\r\n","IsDeferred":false},{"Name":"search() and test() using slice","Code":"var str2 = str.slice(lastIndex)\r\nvar startIndex = str2.search(regex)\r\nif(regex.test(str2)) {\r\n /* do something */\r\n return [startIndex, lastIndex = regex.lastIndex]\r\n}\r\nlastIndex = 0\r\n","IsDeferred":false}]}