Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8244871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:00:05+00:00 2026-06-07T22:00:05+00:00

I have a Jenkins build that copies an artifact from another build. Using description

  • 0

I have a Jenkins build that copies an artifact from another build.

Using description setter plugin I want to extract the build number from which I take the artifact.

The log file contains this line :

Copied 1 artifact from "Mybuild" build number 569

I need to use regex to extract only the integer 569 (can be any int). Also the 1 can be any int and Mybuild can be any string (but no spaces, one word). I can assume the words Copied, artifact, from, build, number are constant and always appear

I have tried to match a regex, but with no luck. Also tried some regex generator websites but no luck either.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:00:07+00:00Added an answer on June 7, 2026 at 10:00 pm

    You could probably use

    Copied (\d+) artifact from "([^"]+)" build number (\d+)
    

    and then use the third group (or remove the parentheses around the first two captured tokens and use group number 1).

    \d refers to any decimal digit, the + trailing it is a so-called quantifier that will try matching the previous token (the digit in this case) at least one times and as often as possible. [^"] is a character class containing any character that is not a double quote. This way we can make sure that we catch everything within the quotes (not strictly necessary here, but a good pattern to keep in mind). All the rest is just matched verbatim.

    Quick PowerShell test:

    PS> 'Copied 1 artifact from "Mybuild" build number 569' -match 'Copied (\d+) artifact from "([^"]+)" build number (\d+)'
    True
    PS> $Matches
    
    Name                           Value
    ----                           -----
    3                              569
    2                              Mybuild
    1                              1
    0                              Copied 1 artifact from "Mybuild" build number 569
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Jenkins build that pulls down my project from github, builds
I have Jenkins installed in Linux and I want to run the build(s) under
Simplified, I have a build release (BR) project in Jenkins that checks out and
I have a Jenkins build project, that builds a Windows driver module for 3-axis
I have a Gradle build in Jenkins with various JUnit tests that are executed
Jenkins supports parametrized builds. I have a deployment build that requires the tag to
We have an automated build system configured using Jenkins, integrate with Gerrit. One of
We have a Jenkins installation that uses the OpenID plugin to authenticate our company
I'm running Jenkins on Mac OS. I have an ant build file that tries
I have a Jenkins build which builds a maven project with -PmyProfile clean package

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.