Ant propertyregex,只替换最后一次出现?

时间:2013-07-09 12:59:26

标签: ant

假设我有一个包abc.bcd.html.efg.Hello.html,我想在不更改包的情况下拆除.html扩展名。我该怎么做?

1 个答案:

答案 0 :(得分:0)

您应该可以使用像

这样的正则表达式执行此操作
(.*)\.html$

(美元与输入字符串的末尾匹配)。这将对应于

<propertyregex property="some.property" input="abc.bcd.html.efg.Hello.html"
    regex="(.*)\.html$$" select="\1" />

使用双倍美元“逃避”单一美元符号被蚂蚁视为房产扩张的一部分 - 见"$$ Expansion" on this page

相关问题