gpt4 book ai didi

java - ANT + propertyregex 问题

转载 作者:行者123 更新时间:2023-11-30 06:35:00 26 4
gpt4 key购买 nike

我在条件中有以下字符串:10.13.0.90:7000

我想将其提取为两个条件,例如 10.13.0.90 和 7000。

我试过了 <propertyregex property="client.ip" input="${client.address}" regexp="[0-9.]*:[0-9]*" select="\1" />但这不起作用。条件肯定是正确的。有什么建议吗?

非常感谢!

最佳答案

\1表示第一个分组。但你根本没有分组()

试试这个:

<propertyregex property="client.ip" input="${client.address}" 
regexp="([0-9\.]*):[0-9]*" select="\1" />

关于java - ANT + propertyregex 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6492216/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com