regex替换所有圆点最后一个不起作用

问题描述 投票:0回答:1

我尝试重命名一堆文件名,以便使用SED的时期(最后一个)被过度替换。

我尝试了(请参阅下文),但它不起作用...脚本有什么问题?

echo "test.test.test.txt" | sed -e "s/\.(?=.*\.)/-/g"
在:

test.test.test.txt


the of the Guest:

test-test-test.txt

    

regex bash sed
1个回答
0
投票
\.(?=.*\.)


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.