标签: r
例如,如果单词是happy,那么:
happy
输入:"The Bunny is happy to be alive, the Rabbit is happy too"
"The Bunny is happy to be alive, the Rabbit is happy too"
输出:"The Bunny is happyto be alive, the Rabbit is happytoo"
"The Bunny is happyto be alive, the Rabbit is happytoo"
谢谢
答案 0 :(得分:1)
使用以下正则表达式
(?<=happy)\\s
在您的问题的评论中,您正在替换字上的字 + whitesace 。但是在上面的方法中,您正在删除仅空格。