如何在replaceregexp中指定属性

时间:2012-05-17 05:04:11

标签: java android regex ant


我不知道如何为my.property = any * ????

指定通配符

我还需要知道如何设置一个将my.property设置为空值的替换?

以下是一个例子:

   <replaceregexp file="./project.properties"
                        match='someproperty.value="(.*)"'
                        replace='somepropert.value=othervalue'
                        byline="false">         
    </replaceregexp>

我要问的非常简单。如何使用ant脚本中的replaceregexp在属性文件中设置和取消设置属性。多数民众赞成。

1 个答案:

答案 0 :(得分:0)

你必须使用实体作为“

&#34;

逃避点

\.

匹配会看起来

match='someproperty\.value=&#34;.*&#34;'

括号是不必要的。

相关问题