我有一个像下面这样的字符串 C:\部署\ dep_Scripts \ OSB \配置\ sbconfig1.jar 从这个字符串我想只提取文件名sbconfig1
我怎样才能使用正则表达式
答案 0 :(得分:0)
Ant的basename任务执行此操作:https://ant.apache.org/manual/Tasks/basename.html
<basename property="jar.name.without.extention" file="C:\deployment\dep_Scripts\OSB\configuration\sbconfig1.jar" suffix="jar"/>
<echo message="${jar.name.without.extention}"/>