可以在Phing replaceregexp任务中使用反向查找吗?

可以在Phing replaceregexp任务中使用反向查找吗?,regex,phing,negative-lookbehind,Regex,Phing,Negative Lookbehind,尝试将负lookbehind正则表达式放入Phing replaceregexp任务并收到错误: BUILD FAILED Error reading project file [wrapped: C:\path\to\build.xml:110:29: > required] Total time: 0.4800 seconds 我发现尖括号在xml中是个问题。有没有一种方法可以在构建文件中指定负lookbehind正则表达式,或者这是用于自定义任务的 我的目标是将文件中的引用重命名为

尝试将负lookbehind正则表达式放入Phing replaceregexp任务并收到错误:

BUILD FAILED
Error reading project file [wrapped: C:\path\to\build.xml:110:29: > required]
Total time: 0.4800 seconds
我发现尖括号在xml中是个问题。有没有一种方法可以在构建文件中指定负lookbehind正则表达式,或者这是用于自定义任务的

我的目标是将文件中的引用重命名为“.js”,同时保留所有现存的“.min.js”引用,并使用类似的方式:

(<script)(.*)(src=\")(.*)(?<!\.min)(\.js\")

(将正则表达式放入属性文件:

minify_path_regex=(<script)(.*)(src=\")(.*)(?<!\.min)(\.js\")

minify_path_regex=(非常感谢。通过将模式放在build.properties而不是build.xml中,我解决了这个问题。
<copy todir="${builddir}/custom_errors" >
    <filterchain>
        <replaceregexp>
            <regexp pattern="${minify_path_regex}" replace="\1\2\3\4.min\5" />
        </replaceregexp>
    </filterchain>
    <fileset refid="allPages" />
</copy>