正则匹配出错

2018-12-04 09:52:54
就是这个正则匹配的文本 出现错误

下面这个是js源码
  1. /*
  2. 由于ios12系统权限问题导致url以及文件方式分享的脚本都不能通过 URL Schemes 以及 Action Extension 来进行安装了,虽然还可以用复制代码的方式来安装我们的脚本。但是复制代码这个方法比较麻烦。所以是很有必要写这么一个脚本,为了方便我自己的同时也方便大家。所以分享这个脚本给大家。
  3. jsbox脚本安装器使用也很简单,我们只需要复制脚本的分享链接,然后运行这个脚本安装器就可以安装了。非常方便快捷。
  4. by:iPhone 8、小良
  5. http://ae85.cn/
  6. */
  7. if ($app.info.bundleID == "app.cyan.pin") {
  8. $ui.alert("该脚本不支持Pin!\n只支持JSBox \n\npin请使用复制代码方式添加");
  9. $app.openURL("http://qq.cn.hn/g4s");
  10. return;
  11. }
  12. if ($app.env == $env.action) {
  13. var data = $context.data
  14. var name = data.fileName
  15. install(data, name)
  16. return;
  17. }
  18. var link = $clipboard.link
  19. if (link) {
  20. if (link.indexOf('jsbox://') !== -1) {
  21. urlcl(link)
  22. } else {
  23. $http.get({
  24. url: link,
  25. header: {
  26. "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1"
  27. },
  28. handler: function (resp) {
  29. var data = resp.data
  30. var link = data.match(/jsbox:\/\/(\S*?)\'/)[1]
  31. urlcl(link)
  32. }
  33. })
  34. }
  35. } else {
  36. $ui.alert({
  37. title: "温馨提示:",
  38. message: "\n请先复制脚本链接再运行!\n\n不会使用?看看教程吧!",
  39. actions: [{
  40. title: "查看图文教程",
  41. handler: function () {
  42. $app.openURL("http://qq.cn.hn/g43");
  43. }
  44. },{
  45. title: "观看视频教程",
  46. handler: function () {
  47. $app.openURL("http://t.cn/E2gUpNI");
  48. }
  49. },{
  50. title: "取消"
  51. }]
  52. });
  53. }
  54. function urlcl(link) {
  55. var shu = link.split("&")
  56. var url = $text.URLDecode(shu[0].split("url=")[1])
  57. if (url.indexOf('/blob/master/') !== -1) {
  58. url = url.replace(/\/blob\/master\//, "/raw/master/")
  59. }
  60. var name = $text.URLDecode(shu[1].split("name=")[1])
  61. $ui.toast("正在安装中 ...");
  62. $http.download({
  63. url: url,
  64. handler: function (resp) {
  65. install(resp.data, name)
  66. }
  67. })
  68. }
  69. function install(data, name) {
  70. $addin.save({
  71. name: name,
  72. data: data,
  73. handler: function () {
  74. $ui.alert({
  75. title: "安装完成",
  76. message: "\n是否打开?\n" + name,
  77. actions: [
  78. {
  79. title: "打开",
  80. handler: function () {
  81. $app.openExtension(name)
  82. $app.close(delay)
  83. }
  84. },
  85. {
  86. title: "不了"
  87. }]
  88. });
  89. }
  90. })
  91. }
下面这个是要匹配的文本
  1. "<!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="HandheldFriendly" content="true">
  8. <meta name="renderer" content="webkit">
  9. <meta name="format-detection" content="telephone=no">
  10. <title>小良-规则、脚本、解析 、应用、教程、下载</title>
  11. <meta name="keywords" content="小良更新器,workflow,pin,jsbox,vip,教程,workflow规则,js脚本"/>
  12. <meta name="description" content="小良-规则、脚本、解析、应用、教程、下载"/>
  13. <meta name="keywords" content="">
  14. <link href="skin/css/style.css" rel="stylesheet" type="text/css" />
  15. <link rel="stylesheet" href="skin/css/menes.min.css">
  16. <script src="skin/js/menes.js" type="text/javascript"></script>
  17. <script src="skin/js/jquery.min.js"></script>
  18. </head>
  19. </style>
  20. </head>
  21. <body>
  22. <div id="max_box">
  23. <div class="logo animated fadeInUp">
  24. <span>官网</span>
  25. <img src="skin/images/logo.png" alt="logo">
  26. <body oncontextmenu="return false" onselectstart="return false">
  27. </div>
  28. <!-- 原始颜色#5A614A -->
  29. <style type="text/css">
  30. a:visited {
  31. color: #ffffff; text-decoration: none
  32. }
  33. a:link {
  34. color: #ffffff; text-decoration: none
  35. }
  36. a:hover {
  37. color: #004eff; text-decoration: none
  38. }
  39. </style>
  40. <script language="javascript">
  41. <!--
  42. // ------ 定义全局变量
  43. var theNewsNum;
  44. var theAddNum;
  45. var totalNum;
  46. var CurrentPosion=0;
  47. var theCurrentNews;
  48. var theCurrentLength;
  49. var theNewsText;
  50. var theTargetLink;
  51. var theCharacterTimeout;
  52. var theNewsTimeout;
  53. var theBrowserVersion;
  54. var theWidgetOne;
  55. var theWidgetTwo;
  56. var theSpaceFiller;
  57. var theLeadString;
  58. var theNewsState;
  59. function startTicker()
  60. {
  61. // ------ 设置初始数值
  62. theCharacterTimeout = 50;//字符间隔时间
  63. theNewsTimeout = 3000;//新闻间隔时间
  64. theWidgetOne = "_";//新闻前面下标符1
  65. theWidgetTwo = "-";//新闻前面下标符
  66. theNewsState = 1;
  67. //theNewsNum = document.body.children.incoming.children.NewsNum.innerText;//新闻总条数
  68. //add by lin
  69. theNewsNum = document.getElementById("incoming").children.AllNews.children.length;//新闻总条数
  70. theAddNum = document.getElementById("incoming").children.AddNews.children.length;//补充条数
  71. totalNum =theNewsNum+theAddNum;
  72. theCurrentNews = 0;
  73. theCurrentLength = 0;
  74. theLeadString = " ";
  75. theSpaceFiller = " ";
  76. runTheTicker();
  77. }
  78. // --- 基础函数
  79. function runTheTicker()
  80. {
  81. if(theNewsState == 1)
  82. {
  83. if(CurrentPosion<theNewsNum){
  84. setupNextNews();
  85. }
  86. else{
  87. setupAddNews();
  88. }
  89. CurrentPosion++;
  90. if(CurrentPosion>=totalNum||CurrentPosion>=5) CurrentPosion=0; //最多条数不超过5条
  91. }
  92. if(theCurrentLength != theNewsText.length)
  93. {
  94. drawNews();
  95. }
  96. else
  97. {
  98. closeOutNews();
  99. }
  100. }
  101. // --- 跳转下一条新闻
  102. function setupNextNews()
  103. {
  104. theNewsState = 0;
  105. theCurrentNews = theCurrentNews % theNewsNum;
  106. theNewsText = document.getElementById("AllNews").children[theCurrentNews].children.Summary.innerText;
  107. theTargetLink = document.getElementById("AllNews").children[theCurrentNews].children.NewsLink.innerText;
  108. theCurrentLength = 0;
  109. document.all.hottext.href = theTargetLink;
  110. theCurrentNews++;
  111. }
  112. function setupAddNews()
  113. {
  114. theNewsState = 0;
  115. theCurrentNews = theCurrentNews % theAddNum;
  116. theNewsText = document.getElementById("incoming").children.AddNews.children
  117. [theCurrentNews].children.Summary.innerText;
  118. theTargetLink = document.getElementById("incoming").children.AddNews.children
  119. [theCurrentNews].children.NewsLink.innerText;
  120. theCurrentLength = 0;
  121. document.all.hottext.href = theTargetLink;
  122. theCurrentNews++;
  123. }
  124. // --- 滚动新闻
  125. function drawNews()
  126. {
  127. var myWidget;
  128. if((theCurrentLength % 2) == 1)
  129. {
  130. myWidget = theWidgetOne;
  131. }
  132. else
  133. {
  134. myWidget = theWidgetTwo;
  135. }
  136. document.all.hottext.innerHTML = theLeadString + theNewsText.substring(0,theCurrentLength) + myWidget +
  137. theSpaceFiller;
  138. theCurrentLength++;
  139. setTimeout("runTheTicker()", theCharacterTimeout);
  140. }
  141. // --- 结束新闻循环
  142. function closeOutNews()
  143. {
  144. document.all.hottext.innerHTML = theLeadString + theNewsText + theSpaceFiller;
  145. theNewsState = 1;
  146. setTimeout("runTheTicker()", theNewsTimeout);
  147. }
  148. window.onload=startTicker;
  149. //-->
  150. </script>
  151. <!-- 一种文字颜色渐变效果的超级连接特效 -->
  152. <script>
  153. <!--
  154. document.onmouseover = domouseover;
  155. document.onmouseout = domouseout;
  156. function domouseover() {
  157. if(document.all){
  158. srcElement = window.event.srcElement;
  159. if (srcElement.className.indexOf("fade") > -1) {
  160. var linkName = srcElement.name;
  161. fadein(linkName);
  162. }
  163. }
  164. }
  165. function domouseout() {
  166. if (document.all){
  167. srcElement = window.event.srcElement;
  168. if (srcElement.className.indexOf("fade") > -1) {
  169. var linkName = srcElement.name;
  170. fadeout(linkName);
  171. }
  172. }
  173. }
  174. function makearray(n) {
  175. this.length = n;
  176. for(var i = 1; i <= n; i++)
  177. this[i] = 0;
  178. return this;
  179. }
  180. hexa = new makearray(16);
  181. for(var i = 0; i < 10; i++)
  182. hexa[i] = i;
  183. hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
  184. hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
  185. function hex(i) {
  186. if (i < 0)
  187. return "00";
  188. else if (i > 255)
  189. return "ff";
  190. else
  191. return "" + hexa[Math.floor(i/16)] + hexa[i%16];}
  192. function setbgColor(r, g, b, element) {
  193. var hr = hex(r); var hg = hex(g); var hb = hex(b);
  194. element.style.color = "#"+hr+hg+hb;
  195. }
  196. function fade(sr, sg, sb, er, eg, eb, step, direction, element){
  197. for(var i = 0; i <= step; i++){
  198. setTimeout("setbgColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+ ")),Math.floor(" +sb+ " *((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
  199. }
  200. }
  201. function fadeout(element) {
  202. fade(255,153,0, 0,0,0, 30, 1, element);
  203. }
  204. /*------------------=[fadein]=----------------------
  205. ||Fades the text from one color to another color ||
  206. ||when the mouse moves over the link. ||
  207. ||-------------------------------------------------*/
  208. function fadein(element) {
  209. fade(0,0,0, 255,153,0, 18, 1, element);
  210. }
  211. /*ignore this >>>>*/
  212. function fadeIn2(id){
  213. fade(255,255,255, 88,118,152, 25, 1, id);
  214. }
  215. function fadeOut2(id){
  216. fade(88,118,152, 255,255,255, 29, 1, id);
  217. }
  218. /*<<<<< stop ignoring =)*/
  219. // -->
  220. </script>
  221. <div id="visible" class="ad_box animated fadeInUp">
  222. <font style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" color="#FF0000">◄〉公告:<a class="fade" id="hottext" href="http://ae85.cn/" target="_blank" name="a"></a></font></div>
  223. <div id="incoming" style="display: none;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;" class="animated fadeInUp">
  224. <div id="AllNews">
  225. <div id="1">
  226. <div id="Summary">①、【js版】直播-秋名山见 1.4(更新日期:2018.10.10)</div>
  227. <div id="NewsLink">jsbox/zbqms.html</div></div>
  228. <div id="2">
  229. <div id="Summary">②、【规则】YouTube视频下载(更新日期:2018.10.9)</div>
  230. <div id="NewsLink">workflow://import-workflow/?url=https%3A%2F%2Fgitee.com%2Fyao07%2Fupdate_device%2Fraw%2Fmaster%2F%25E8%25A7%2584%25E5%2588%2599%2FYouTube%25E8%25A7%2586%25E9%25A2%2591%25E4%25B8%258B%25E8%25BD%25BD&name=YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD</div></div>
  231. <div id="3">
  232. <div id="Summary">③、【规则】Workflow规则安装器(更新日期:2018.10.8)</div>
  233. <div id="NewsLink">workflow://import-workflow/?url=https%3A%2F%2Fgitee.com%2Fyao07%2Fupdate_device%2Fraw%2Fmaster%2F%25E8%25A7%2584%25E5%2588%2599%2FWorkflow%25E8%25A7%2584%25E5%2588%2599%25E5%25AE%2589%25E8%25A3%2585%25E5%2599%25A8&name=Workflow%E8%A7%84%E5%88%99%E5%AE%89%E8%A3%85%E5%99%A8</div></div>
  234. <div id="4">
  235. <div id="Summary">④、【js版】赛事直播 1.1(更新日期:2018.10.8)</div>
  236. <div id="NewsLink">jsbox/sszb.html</div></div>
  237. <div id="5">
  238. <div id="Summary">⑤、【js版】贴吧签到 1.3(更新:2018.9.27)</div>
  239. <div id="NewsLink">jsbox/tieba.html</div></div></div>
  240. <div id="AddNews"></div></div>
  241. <panel class="ad_box animated fadeInUp">
  242. <div class="pic-box">
  243. <ul>
  244. <li id="fuck5h"><a href="lxfs.html" target="new"><img id="fuck5hous" class="bigpic" src="skin/images/AD5.jpg" /></a></li>
  245. <li id="fuck5h"><a href="gz.html" target="new"><img class="bigpic" src="skin/images/AD1.jpg" /></a></li>
  246. <li id="fuck5h"><a href="qt.html" target="new"><img class="bigpic" src="skin/images/AD2.jpg" /></a></li>
  247. <li id="fuck5h"><a href="jb.html" target="new"><img class="bigpic" src="skin/images/AD0.jpg" /></a></li>
  248. <li id="fuck5h"><a href="jsbox/gxq.html" target="new"><img class="bigpic" src="skin/images/AD4.jpg" /></a></li>
  249. </ul>
  250. </div>
  251. </panel>
  252. <script src="skin/js/main.js" type="text/javascript"></script>
  253. <div class="ad_box animated fadeInUp">
  254. <table>
  255. <tbody>
  256. <tr>
  257. <td><a href="lxfs.html"><img src="skin/images/banner.gif" alt=""></a></td>
  258. <td><a href="http://www.miaopai.com/u/paike_agjgihl1hv"><img src="skin/images/bannerr.gif" alt=""></a></td>
  259. </tr>
  260. <tr>
  261. <td class="animated fadeInUp"><a href="workflow://import-workflow/?url=https%3A%2F%2Fgitee.com%2Fyao07%2Fupdate_device%2Fraw%2Fmaster%2Fxiaoliao3.3&name=%E5%B0%8F%E8%89%AF%20-%20%E6%9B%B4%E6%96%B0%E5%99%A8%203.3"><img src="skin/images/wfbjt.jpg" alt=""></a></td>
  262. <td class="animated fadeInUp"><a href="jsbox/gxq.html"><img src="skin/images/jsbjt.jpg" alt=""></a></td>
  263. </tr>
  264. <!-- <tr>
  265. <td colspan="2"><p><a href="/box/iPhone.html">调试</a></p></td>
  266. </tr>
  267. -->
  268. </tbody>
  269. </table>
  270. </div>
  271. <div class="body_box footer_tb animated fadeInUp ">
  272. <table>
  273. <tbody>
  274. <tr>
  275. <td><a href="gz.html">Workflow规则</a></td>
  276. <td><a href="jb.html">js 脚本</a></td>
  277. </tr>
  278. <tr class="animated fadeInUp">
  279. <td><a href="yy.html">破解应用</a></td>
  280. <td><a href="jx.html">视频解析</a></td>
  281. </tr>
  282. <tr class="animated fadeInUp">
  283. <td class="animated fadeInUp"><a href="qt.html">视频教程</a></td>
  284. <td class="animated fadeInUp"><a href="lxfs.html">关于小良</a></td>
  285. </tr>
  286. </tbody>
  287. </table>
  288. </div>
  289. <div class="body_box animated fadeInUp ">
  290. <img src="skin/images/tedian.jpg" alt="">
  291. </div>
  292. <div class="ad_box animated fadeInUp">
  293. <table class="animated fadeInUp">
  294. <tbody>
  295. <tr>
  296. <td><span>解析</span><a href="jx.html" "_blank"><img src="skin/images/adjx1.jpg" alt=""></a></td>
  297. <td><span>在线</span><a href="zx.html" "_blank"><img src="skin/images/adzx2.jpg" alt=""></a></td>
  298. </tr>
  299. </tbody>
  300. </table>
  301. </div>
  302. <div class="footer animated fadeInUp">
  303. <p><span>小良(2018)唯一官方网站</span></p>
  304. <p>版权所有 iPhone 8、小良 ©2016~2018 <br>
  305. <a href="#">- 感谢访问 - ae85.cn -</a></p>
  306. </div>
  307. <br>
  308. </div>
  309. <script>
  310. document.oncontextmenu = function(){
  311. return false;
  312. }
  313. document.onkeydown = function(){
  314. if (event.ctrlKey && window.event.keyCode==67){
  315. return false;
  316. }
  317. }
  318. document.body.oncopy = function (){
  319. return false;
  320. }
  321. document.onselectstart = function(){
  322. return false;
  323. }
  324. window.onkeydown = window.onkeyup = window.onkeypress = function (e) {
  325. window.event.returnValue = false;
  326. console.log('Key:',e.key);
  327. return false;
  328. }
  329. </script>
  330. </body>
  331. <meta name="baidu-site-verification" content="ipaJrbaEND" />
  332. </html>
  333. "

0
0
0

添加评论

正在回复:
取消
2
0
0
0