Regular Expressions 101

Community Patterns

Parse drupal version info from filename

1

Regular Expression
PCRE (PHP <7.3)

/
^(?<project>\w+)-(?<core>\d+\.x)-(?<major>\d+)\.(?<patch>[\dx]+)[-\.]?(?<extra>[^\.]+)?\.(tar\.gz|tgz)$
/
mg

Description

no description available

Submitted by Jason Smith - 10 years ago