使用javascript中的正则表达式从查询字符串中删除plsql类型
我有一堆字符串,看起来像这样:使用javascript中的正则表达式从查询字符串中删除plsql类型,javascript,regex,Javascript,Regex,我有一堆字符串,看起来像这样: Select my_type(thing1, thing2, thing3) From a_table where this_other_thing = 'blah' and the_last_thing = a_code 我需要能够从“thing1,thing2,thing3”中删除“我的类型(“和结束”)” 我可以把第一部分和第二部分搭配起来 /my_type[(]/i 但我没能抓住最后的括号。我正在为此使用javascript。以下是获得结果的方法:
Select my_type(thing1, thing2, thing3) From a_table where this_other_thing = 'blah' and the_last_thing = a_code
我需要能够从“thing1,thing2,thing3”中删除“我的类型(“和结束”)”
我可以把第一部分和第二部分搭配起来
/my_type[(]/i
但我没能抓住最后的括号。我正在为此使用javascript。以下是获得结果的方法:
var str=“从一个表中选择我的类型(thing1、thing2、thing3),其中this\u other\u thing='blah'和最后一个\u thing=a\u code”;
var results=str.match(/my_type\(.*)\)/i);
//所有参数都作为字符串显示
console.log(结果[1]);
//数组中的每个参数
log(结果[1]。拆分(/,*/)谢谢,弗兰克兹。工作完美。