Regular Expressions 101

Community Patterns

Grab CalVer from git tags

0

Regular Expression
PCRE2 (PHP >=7.3)

/
v\d+\.\d+\.\d+\.\d+
/
gm

Description

When using git ls-remote --tags --sort=version:refname, the results display the git hash as well as a refs prefix. This regex grabs only the CalVer string.

Submitted by John Obla - a year ago