在下面给出的代码中,我想用"<a url>"
替换所有出现的"link"
,但gsub
并不认识到重复出现:
stringx<- " word1 word1 word1 <a url> /n word word word <a url> word
word word <a url> abcd"
gsub('<{1}.* *>', "link", stringx )
输出:&#34; word1 word1 word1 link abcd&#34;
期望的输出:&#34; word1 word1 word1 link1 link word word word link word word word link abcd&#34;
我不明白我做错了什么 谢谢!