gpt4 book ai didi

jenkins - 从 BUILD_LOG_REGEX 提取的行中删除 "[string]"

转载 作者:行者123 更新时间:2023-12-04 18:12:05 25 4
gpt4 key购买 nike

这是我的示例字符串。

[echo] SampleProject 解决方案目前有 85% 的代码覆盖率。

我想要的输出应该是。

SampleProject 解决方案目前具有 85% 的代码覆盖率。

顺便说一句,我解决了这个问题,因为我正在使用 Jenkins 浏览我的 CI 中的日志。

有什么帮助吗?谢谢..

最佳答案

你可以试试substText BUILD_LOG_REGEX 中的参数用于替换与您的 regex 匹配的文本的标记

New optional arg: ${BUILD_LOG_REGEX, regex, linesBefore, linesAfter, maxMatches, showTruncatedLines, substText} which allows substituting text for the matched regex. This is particularly useful when the text contains references to capture groups (i.e. $1, $2, etc.)

关于jenkins - 从 BUILD_LOG_REGEX 提取的行中删除 "[string]",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12417832/

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