小编use*_*919的帖子

正则表达式以任意顺序删除特定单词

我要替换(删除)特定的可选单词(AAA,BBB,CCC),这些单词在特定单词(ALWAYS_THERE)前后紧随其后

this is important AAA BBB ALWAYS_THERE CCC
this is important BBB AAA ALWAYS_THERE CCC
this is important AAA CCC ALWAYS_THERE BBB
this is important BBB ALWAYS_THERE CCC AAA
this is important BBB this also ALWAYS_THERE CCC AAA
Run Code Online (Sandbox Code Playgroud)

this is important
this is important
this is important
this is important
this is important BBB this also
Run Code Online (Sandbox Code Playgroud)

如何在perl(或UNIX上的任何其他可用程序)中完成此操作?

regex perl words substitution optional

1
推荐指数
1
解决办法
4143
查看次数

标签 统计

optional ×1

perl ×1

regex ×1

substitution ×1

words ×1