Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 如何在Ant中使用正则表达式替换xml标记之间的值?_Regex_Xml_Ant - Fatal编程技术网

Regex 如何在Ant中使用正则表达式替换xml标记之间的值?

Regex 如何在Ant中使用正则表达式替换xml标记之间的值?,regex,xml,ant,Regex,Xml,Ant,我尝试使用Ant替换xml中的值 我的xml文件: <session-config> <session-timeout>60</session-timeout> </session-config> 但在执行后从ant获得致命错误: [Fatal Error] The value of attribute "match" associated with an element type "replaceregexp" must not co

我尝试使用Ant替换xml中的值

我的xml文件:

<session-config>
    <session-timeout>60</session-timeout>
</session-config>
但在执行后从ant获得致命错误:

[Fatal Error] The value of attribute "match" associated with an element type "replaceregexp"
 must not contain the '<' character.
[致命错误]与元素类型“replaceregexp”关联的属性“match”的值
不得包含“
字符必须分别使用
进行“转义”:

<replaceregexp file="WEB-INF/web.xml"
              byline="true"
              match="((?&lt;=session-timeout\&gt;)[\S\s]*?(?=\&lt;\/session-timeout))"
              replace='20'/>

<replaceregexp file="WEB-INF/web.xml"
              byline="true"
              match="((?&lt;=session-timeout\&gt;)[\S\s]*?(?=\&lt;\/session-timeout))"
              replace='20'/>