Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.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
Ant:使用propertyregex获取多个匹配项_Ant - Fatal编程技术网

Ant:使用propertyregex获取多个匹配项

Ant:使用propertyregex获取多个匹配项,ant,Ant,我在HTML文件中有以下示例行: test.ABC.test test.ABCD.test test.ABCE.test 这是Ant propertyregex: 但我想要所有的火柴。我怎样才能得到它 ABC ABCD ABCE 因此?不确定propertyregex问题,但这在没有ant contrib的情况下有效: <target name="test"> <loadfile property="record" srcFile="./index.html">

我在HTML文件中有以下示例行:

test.ABC.test
test.ABCD.test
test.ABCE.test
这是Ant propertyregex:

但我想要所有的火柴。我怎样才能得到它

ABC
ABCD
ABCE

因此?

不确定propertyregex问题,但这在没有ant contrib的情况下有效:

<target name="test">
    <loadfile property="record" srcFile="./index.html">
        <filterchain>
            <tokenfilter>
                <containsregex pattern=".*test\.([^\.]*)\.test.*" replace="\1"/>
            </tokenfilter>
        </filterchain>
    </loadfile>
    <echo message="${record}" />
</target>

不确定propertyregex问题,但这在没有ant contrib的情况下有效:

<target name="test">
    <loadfile property="record" srcFile="./index.html">
        <filterchain>
            <tokenfilter>
                <containsregex pattern=".*test\.([^\.]*)\.test.*" replace="\1"/>
            </tokenfilter>
        </filterchain>
    </loadfile>
    <echo message="${record}" />
</target>
<target name="test">
    <loadfile property="record" srcFile="./index.html">
        <filterchain>
            <tokenfilter>
                <containsregex pattern=".*test\.([^\.]*)\.test.*" replace="\1"/>
            </tokenfilter>
        </filterchain>
    </loadfile>
    <echo message="${record}" />
</target>