作者No (you stay there)
看板RegExp
标题Re: [问题] 该怎麽写(改善) 我的 Regexp
时间Fri May 10 22:24:49 2013
※ 引述《hpo14 (雨)》之铭言:
我用JavaScript测试的
但应该差不多,要是不能用中文的话,把中文转\uXXXX看看
/cview\('(\d+)-(\d+)\.html',(\d+)[^第番]+(第\d+[卷话]|番外\d+)/
^^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^
共四个sub-group
==============测试资料=============
<!-- 一堆 html -->
<td style="width:10%;white-space:nowrap;"><a h
ref='#'
onclick="cview('102-1.html',1);return false;" id="c1" class="Vol">
第01卷</a></td><td style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-2.html',1);return false;" id="c1" class="Vol">
第02话</a></td><td style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-3.html',1);return false;" id="c3" class="Vol">
<font color=red id=lch>第03话</font></a></td><td
style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-4.html',1);return false;" id="c4" class="Vol">
第04话 各话标题</a></td><td style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-5.html',1);return false;" id="c4" class="Vol">
<font color=red id=lch>第05话 各话标题</font></a></td><td
style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-6.html',1);return false;" id="c4" class="Vol">
番外06</a></td><td style="width:10%;white-space:nowrap;"><a href='#'
onclick="cview('102-7.html',1);return false;" id="c4" class="Vol">
<font color=red id=lch>番外07</font></a></td><td
style="width:10%;white-space:nowrap;"><a href='#'
以此後面类推
<!-- 一堆 html -->
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.192.72.221
1F:推 s25g5d4:这解法比我的还简洁有力阿 推 05/10 22:32
2F:推 Rockspirit:学长超强~推! 05/26 23:05