81,091
社区成员
发帖
与我相关
我的任务
分享
public static void main(String args[]) throws Exception {
String s = "getSelectIndex(document.form1.insurantIDType_group, \"01\")getSelectIndex(document.form1.insurantIDType_group, '01')";
Matcher m = Pattern.compile("(.+?)\\(.+?,\\s*(\"|')(.+?)(\"|')\\)").matcher(s);
while(m.find()){
System.out.println(m.group(1));
System.out.println(m.group(3));
}
}
var str = 'getSelectIndex(document.form1.insurantIDType_group, "01")';
var str1 = "getSelectIndex(document.form1.insurantIDType_group, '01')";
var re = /^.+?form1\.(.+?),\s?(['"])(\d+)\2\)$/i;
alert(str.match(re)[1])
alert(str.match(re)[3])
alert(str1.match(re)[1])
alert(str1.match(re)[3])