我有一个字符串:
Started by upstream project "fcm-dummy-web" build number 99
originally caused by:
Started by user Kaul, Kuber
[EnvInject] - Loading node environment variables.
Building on master in workspace /var/lib/jenkins/jobs/mischief-managed/workspace
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url
Fetching upstream changes from https://xx/kaulk/mischief-managed.git
> /usr/bin/git --version # timeout=10
using GIT_SSH to set credentials
我需要在第一行中找到作业名称,在这里是“fcm dummy web”和内部版本号“99”。现在,对于不同的工作,这些可能会在不同的构建中发生变化,但在所有情况下,第一行将以“startedbyupstreamproject”开头,后面是“buildnumber”值。正则表达式能找到它吗?你知道吗
我在试:火柴=关于芬德尔(r“^Started by upstream project.*$”,text)未成功。你知道吗
您可以这样搜索:
每当正则表达式中使用锚点时,使用多行修饰符
m
。你知道吗DEMO
相关问题 更多 >
编程相关推荐