Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
repository:\s+['"]?(?<depName>[_\-\/\w]+)['"]?,?\s+tag:\s+['"]?(?<currentValue>[_\-\.\w]+)['"]?
/
gm

Description

Match:

  image: { repository: user_name-123/repo_name-123, tag: v1.23.45_amd64-cluster }

  image:
    repository: "user_name-123/repo_name-123"
    tag: 'v1.23.45_amd64-cluster'
Submitted by Yevhen Kolomeiko (Sad-Soul-Eater) - 7 months ago (Last modified 7 months ago)