正则表达式-非捕获性分组

<div id="article_content" class="article_content tracking-ad" data-mod="popu_307" data-dsm="post">


<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">非捕获性分组语法为(?:pattern),即将pattern部分组合成一个可统一操作的组合项,但不把这部分内容当作子匹配捕获,匹配的内容部进行编号也不存储在缓冲区中供以后使用。非捕获性分组方法在必须进行组合、但又不想对组合的部分进行缓存的情况下非常有用。</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">例如,要在一篇英文资料中查找"program"和"project"两个单词,正则表达式可表示为/program|project/,也可表示为/pro(gram|ject)/,但是缓存子匹配(gramject)没有意义,就可以用/pro(?:gram|ject)/进行非捕获性匹配这样既可以简洁匹配又可不缓存无实际意义的字匹配。</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>实例:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;script type="text/javascript"&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;!--</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var str = "program,a good project";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var reg = /program|project/g;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var msg;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">--&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;/script&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>输出:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">program成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">project成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">-----------------------------------------------------------------------------------------------------------------</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>实例:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;script type="text/javascript"&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;!--</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var str = "program,a good project";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var reg = /pro(gram|ject)/g;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var msg;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">--&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;/script&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>输出:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">program,gram成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">project,ject成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">-----------------------------------------------------------------------------------------------------------------</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>实例:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;script type="text/javascript"&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;!--</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var str = "program,a good project";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var reg = /pro(?:gram|ject)/g;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">var msg;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败&lt;br&gt;";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">arr = reg.exec(str);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">if(arr){</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = arr+"成功匹配";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}else{</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&nbsp;msg
 = "匹配失败";</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">}</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">document.write(msg);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">--&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">&lt;/script&gt;</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="word-wrap:normal; word-break:normal; line-height:21px; color:rgb(50,62,50); font-family:simsun; font-size:14px; background-color:rgb(243,243,243)"><strong>输出:</strong></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">program成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">project成功匹配</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(243,243,243)">
<br>
   
</div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值