Regular Expressions 101

Community Patterns

git-flow branch names

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(^(bugfix|feature)\/[a-z0-9]+(-[a-z0-9]+)*(-[0-9]+)?$|^(hotfix|support)\/(\d+.\d+.\d+)$|^(develop|main|release|staging)$)
/
gm

Description

This is the regex for our branch names.

Submitted by stefanfrede - 6 months ago