Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
([6]\.[1]\.([3-9]$|[1-9]\d{1,}))|([6]\.([2-9]|[1-9]\d{1,})\.\d*)|(([7-9]|[1-9]\d{1,})\.\d*\.\d*)
/
m

Description

This regular expression will match app versions following the Semantic Versioning scheme greater than or equal to 6.1.3

The first capturing group will match app versions 6.1., where the patch version is greater than or equal to 3. The second capturing group will match app versions. 6.., where the minor version is greater than or equal to 2 The third capturing group will match app versions .., when the major version is greater than or equal to 7

Submitted by anonymous - 5 years ago (Last modified a year ago)