Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Golang

`
^(?P<image>[^:@]+?)(?::(?P<tag>[^@]+?))?(?:@sha256:(?P<digest>.+))?$
`
mg

Description

Splits a Docker image string into the separate parts:

  • image, tag, digest tag and digest are optional
Submitted by Roemer - a month ago