Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.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

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
ReplaceRegex函数不执行此任务_Regex_Ant_Properties_Boost Regex_Regex Greedy - Fatal编程技术网

ReplaceRegex函数不执行此任务

ReplaceRegex函数不执行此任务,regex,ant,properties,boost-regex,regex-greedy,Regex,Ant,Properties,Boost Regex,Regex Greedy,我想编辑这一行输入,并为产品添加更多值 input="CSDT_FLAG_PRODUCT_FF_FWUIDS=Product_A:45223423;Product_PD:4;Product_CD:345345,22454;Product_F:3423" 我有下面的替换正则表达式行 replaceregexp file="../cms-distribution/src/main/properties/editorial/common/csdtflags.properties" flags="s

我想编辑这一行输入,并为产品添加更多值

 input="CSDT_FLAG_PRODUCT_FF_FWUIDS=Product_A:45223423;Product_PD:4;Product_CD:345345,22454;Product_F:3423"
我有下面的替换正则表达式行

replaceregexp file="../cms-distribution/src/main/properties/editorial/common/csdtflags.properties" flags="s" match="Product_A:([^\.]*)([;])?" replace="Product_A:,${uid}\1" byline="true"/>
除了产生的结果外,这项工作不起作用:

CSDT_FLAG_PRODUCT_FF_FWUIDS=Product_A:+,42e8140a-79ce-4bda-b64a-539bc4a17dbb+,80ab7183-715d-471b-8ae0-b527d2597b06+,......
它不知从何处插入+符号,然后替换产品_a中的原始值。我想在原始值后面加一个逗号。我该怎么做? 谢谢你的帮助


谢谢

我对ant以及它如何处理正则表达式一无所知,但我认为问题在于正则表达式。你有一根绳子

"CSDT_FLAG_PRODUCT_FF_FWUIDS=Product_A:45223423;Product_PD:4;Product_CD:345345,22454;Product_F:3423"
还有一个正则表达式

/Product_A:([^\.]*)([;])?/
匹配到字符的最后一次出现
,因此不匹配产品A下的值,请自己查看

但是,如果您现在知道Product_A键上的值始终是8位字符串,则可以使用此正则表达式:

/Product_A:(.{8});/
()
中的匹配组将捕获代码,这是我所能帮助的,也许这个答案有帮助