我有这个js
var race = {
"id": Number( matches[ i ].match( /gt5bspec\.selectEvent\("/(\d+/\d+)"\)/ )[ 1 ] ),
"laps": Number( matches[ i ].match( /<dd class="lap">.+?(\d+)/ )[ 1 ] ),
"maxEntrants": Number( matches[ i ].match( /entry_max.+?\/>(\d+)<\/dd>/ )[ 1 ] ),
"time": Number( matches[ i ].match( /common\/time\/(\d+)\.png/ )[ 1 ] ),
};
它失败的 SyntaxError: 由于表达式中的引号,我猜测“id”行上的非法字符。
这是用于搜索的示例字符串
<dl class="remote_event_list"> <dd class="course_logo"><img src="/common/images/gt5/remote_race/common/courselogo/ed2539fe892d2c52c42a440354e8e3d5.png" width="84"></dd> <dd class="race_info_minute"><img src="/common/images/gt5/remote_race/common/time/20.png" width="80" height="54" alt=""></dd> <dd class="entry_max"><img src="/common/images/gt5/remote_race/entry/icon_driver.png" width="20" />16</dd> <dd class="lap"><span>Vuelta(s):</span> 12 (en torno a 20 minutos)</dd> <dd class="car_image"> <img src="/common/images/gt5/car/thumbnail/0a712318b3b8acc70daeb1ff71d40140.png" width="178" /> </dd> <dd class="link"><a href="javascript:void(0);" onclick='gt5bspec.selectEvent("/116/1035200")' title="Abt Audi TT-R Touring Car '02 / Circuito de Madrid"> </a></dd></dl>
我正在尝试匹配 /116/1035200 的第 1 组值
谢谢