Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从一组文件中删除一些子字符串。这些文件具有以下名称
0_00008.obj 0_00009.obj 0_00010.obj 0_00011.obj
我希望他们成为
8.obj 9.obj 10.obj 11.obj
我试过这样rename使用
rename
rename '/s/0_0+//;' *.obj
但什么都没有发生?我已经检查了正则表达式字符串,并且看起来它可以正确匹配我想要删除的内容,所以我是否错误地使用了重命名?
您可以使用此模式
^[0_]*
Regex Demo