Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^(?P<repository>[\w.\-_]+((?::\d+|)(?=/[a-z0-9._-]+/[a-z0-9._-]+))|)(?:/|)(?P<image>[a-z0-9.\-_]+(?:/[a-z0-9.\-_]+|))(:(?P<tag>[\w.\-_]{1,127})|)$
"
gmi

Description

Parses docker image tages into repository, name, and tag

Submitted by anonymous - 7 years ago