使用JavaScript更改字符串
我想摆脱使用JavaScript更改字符串,javascript,regex,Javascript,Regex,我想摆脱money='3/3/美元', 使用javascript,如何做到这一点 抱歉,我没有说得很清楚,money=后面的字符串可以是任何东西,但它们肯定是字符串,并且总是以逗号结尾 更多样品 var a = "Text(money ='3/3/dollor',unit=42)"; 我需要的输出是a=“Text(unit=42)”我需要一种通用的方法来实现这一点,“money=”后面的字符串可以是任何东西。@user469652-您需要更具体地说明所有可能的组合、单词和字母。提供5-10个不
money='3/3/美元',
使用javascript,如何做到这一点
抱歉,我没有说得很清楚,money=后面的字符串可以是任何东西,但它们肯定是字符串,并且总是以逗号结尾
更多样品
var a = "Text(money ='3/3/dollor',unit=42)";
我需要的输出是
a=“Text(unit=42)”
我需要一种通用的方法来实现这一点,“money=”后面的字符串可以是任何东西。@user469652-您需要更具体地说明所有可能的组合、单词和字母。提供5-10个不同的字符串示例。@user469652:单引号子字符串(money='…'
)可以包含逗号吗?
var a = "Text(money ='v23f3/.3/dollor',unit=42)";
var a = "Text(money ='3/3fds/d.ollor',unit=42)";
var a = "Text(money ='3.3.3.3/3/d.o/l.lor',unit=42)";
var a = "Text(money ='3/3/dollor',unit=42)";
a = a.replace(/money ='.*',/, "");