jquery正则表达式匹配

时间:2016-06-07 15:56:29

标签: jquery regex

如何构建我的正则表达式".*\\|" + movingReportInstID以匹配此49|25,而不是75|258 movingReportInstID = 25

下面的代码使用情况
set movingReportInstID = 25
for(i = 0; i < origOrderArr.length; ++i){
    if(origOrderArr[i].match(".*\\|" + movingReportInstID)) {
        var origLocation = i;
    }
}

1 个答案:

答案 0 :(得分:0)

使用<!-- FirebaseUI for Facebook Auth --> <script src="https://www.gstatic.com/firebasejs/live/3.0/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/live/3.0/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/ui/0.4.0/firebase-ui-auth.js"></script> <link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/0.4.0/firebase-ui-auth.css" /> ^在字符串的开头和结尾处断言位置:

$