Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
(?P<product_name>^.*)[-]((?P<ver>\*|\d+(\.\d+){0,2}(\.\*)?))[-](?P<build>.\d*)[.](?P<ext>bin|rpm)$
"
gm

Description

find pattern in filename product name, version, build and extension

Submitted by rsim - 3 years ago