当我使用 AJAX 查询服务器时,它返回字符串值。该字符串具有预定义格式,例如:
1|#||4|2352|updatePanel|updatePanelID
<table style="width:100%">
<tr>
<td>
</td>
</tr>
</table>
<table id="requiredTable"/>
<tbody>
<tr>
<th>column1</th>
<th>column2</th>
</tr>
<tr style="cursor:pointer" onclick="FunctionName(11111, 22222, 3);">
<td>trColumn1Info</td>
<td>trColumn2Info</td>
</tr>
some other information
我想通过正则表达式获取FunctionName的第二个参数值。我尝试使用下一个正则表达式,但它总是返回 null:
var forTest = ajaxResultStr.match(/FunctionName\((\S*)\)/g);
alert(forTest);
谁能告诉我,我的模式有什么问题吗? 提前致谢
最佳答案
关于JavaScript 正则表达式匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25195053/