Regular Expressions 101

Community Patterns

0

Url handling

Python
Simple regex to split url
Submitted by Hangfish - a year ago

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

1

Regular Expression
Python

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

Description

Loading markdown...
Submitted by rsim - 2 years ago