2
文件版本我有如下的文件名:從提取的文件名
first_config.txt.1.1
second_config.2.1.1.1
我想從用perl的完整文件名分隔文件名&版本。
first_config.txt & 1.1
second_config & 2.1.1.1
我試過下面的代碼,但它沒有按預期工作。
to extract the version from the complete file name string:
perl -e '$n = "first_config.txt.1.1"; $n =~s/[^\.\d.]//g; print "$n\n";'
to extract the name from the complete file name string:
perl -e '$n = "first_config.txt.1.1"; $n =~s/[\.^\d.]//g; print "$n\n";'