Regular Expressions 101

Community Patterns

1...34567...10

Catch packages from 'tdnf list' output

0

Regular Expression
Golang

`
^\s*([[:alnum:]_.+-]+)\.([[:alnum:]_+-]+)\s+([[:alnum:]._+~-]+)\.([[:alpha:]]+[[:digit:]]+)
`
gm

Description

Every valid line will be of the form: <package_name>.<architecture> <version>.<dist> <repo_id>.

NOTE: the distribution tag is expected to start with at least one letter and be followed by at least one digit.

Submitted by anonymous - a year ago