[英]How can I remove specific strings from a sentence using Regex?
I have this following sentence: Crazy Fredrick bought many very exquisite opal jewels.
我有以下这句话:
Crazy Fredrick bought many very exquisite opal jewels.
and I need to use regex in the following format: 我需要使用以下格式的正则表达式:
Crazy Fredrick bought many very exquisite opal jewels.".replace(/regex goes here/gi,"")
to get the following result: Crazy bought very opal jewels.
得到以下结果:
Crazy bought very opal jewels.
So how can i use regex to query out those specific parts of the sentence? 那么我如何使用正则表达式查询句子的那些特定部分呢?
.replace(/(Fredrick|many|exquisite)/gi,"")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.