【发布时间】:2020-11-19 08:46:49
【问题描述】:
我有一个不同的字符串:
Word1-A-OK
Word2-Sample-R-OK
Word3-A
如何使用正则表达式删除这些(-A, -A-OK, -A-NG, -R, -R-OK, -R-NG, -W, -C) 字符串?我想要的输出是:
Word1
Word2-Sample
Word3
这是我目前的正则表达式:
(\\.|-A|[^\w]+R|[^\w]+OK|[^\w]+NG|[^\w]+W|[^\w]+C)
【问题讨论】:
标签: regex regexp-replace