我有一个正则表达式.*\/(\d+)(?![^(]*\))
,它可以在其他程序中工作,例如,C#.我想在MYSQL中使用它,它返回错误
SELECT REGEXP_SUBSTR(myStr, '.*\/(\d+)(?![^(]*\))'), c.* FROM mytable c;
/* SQL Error (1139): Regex error 'unmatched closing parenthesis at offset 16' */
正则表达式实际上会返回如下结果.它得到了最后一个"/"旁边的数字,而不是在括号内
e.g.,
string: "/13/A01(VE)(S)", expected result: "13"
string: "(2)/1(D/3G)", expected result: "1"
string: "/S03(RED/09)/1/(TN)", expected result: "1"
string: "/2(V)/8", expected result: "8"
string: "/BR03(JTF07)(CE)(W)/9", expected result: "9"
string: "(NT)/2(U/V)(J)", expected result: "2"