如何使用Regex从句子中删除特定字符串?

时间:2014-02-03 16:10:49

标签: javascript regex

我有以下句子:Crazy Fredrick bought many very exquisite opal jewels. 我需要使用以下格式的正则表达式:

Crazy Fredrick bought many very exquisite opal jewels.".replace(/regex goes here/gi,"")

获得以下结果:Crazy bought very opal jewels.
那么我如何使用正则表达式来查询句子的那些特定部分呢?

1 个答案:

答案 0 :(得分:0)

.replace(/(Fredrick|many|exquisite)/gi,"")