Regex 提取两个'之间的字符串_';

Regex 提取两个'之间的字符串_';,regex,string,ant,Regex,String,Ant,我正在寻找一个ANT正则表达式来提取两个\uu之间或abc\u和\u之间的字符串 下面是我正在尝试的正则表达式,没有运气 /xxx/xx_x/xxxx/abc_stringtoextract_x.x.zip 我需要提取stringtoextract <propertyregex property="name" input="@{process}" regexp="(?<=abc_)(.*?)(?=\_)" select="\1" cases

我正在寻找一个ANT正则表达式来提取两个
\uu
之间或
abc\u
\u
之间的字符串 下面是我正在尝试的正则表达式,没有运气

/xxx/xx_x/xxxx/abc_stringtoextract_x.x.zip
我需要提取
stringtoextract

<propertyregex property="name"
     input="@{process}"
     regexp="(?<=abc_)(.*?)(?=\_)" 
     select="\1"
     casesensitive="false"/>
<echo>@{process}</echo>

@{进程}
更换


已修复此问题。

为什么需要检查
abc
?如果介于
abc_
之间,则“下划线之间”的条件已经满足。如果我在任何正则表达式编辑工具中检查此正则表达式,它将返回我想要的字符串,但不是通过ANT。不确定哪里出错。不打印任何-[echo]${name}当使用@{process}时,它只打印我的原始字符串。我没有看到任何来自regex@{process}{process}的结果,我在使用${name}时取得了一些成功,结果是stringtoextract_x,您能帮我从结果中排除“_x”吗?让它以。*abc_([^ _]*)的形式工作谢谢您的帮助。在列包含数据的数据框中,有没有办法做到这一点?
<propertyregex property="name"
    input="${process}"
    regexp="(?&lt;=abc_)(.*?)(?=\_)" 
    select="\1"
    casesensitive="false"/>
<echo>${name}</echo> <!-- instead of process -->
.*abc_([^_]*)