Text Processingflags: i
Semantic Commit Message
Validate Conventional Commits format: type(scope)!: description.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9\-]+\))?(!)?:\s.+ (flags: i)Raw source: ^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-z0-9\-]+\))?(!)?:\s.+
How it works
The first group captures the commit type from the allowed list. (\([a-z0-9\-]+\))? optionally captures a scope in parentheses. (!)? captures a breaking change marker. :\s requires a colon and space before the description. The i flag makes types case-insensitive.
Examples
Input
feat(auth): add OAuth2 loginMatches
feat(auth): add OAuth2 login
Input
fix!: correct null pointer in parserMatches
fix!: correct null pointer in parser
Input
random commit messageNo match
—Common use cases
- •Git commit-msg hooks
- •Automated changelog generation
- •PR title validation in CI
- •Release tooling (semantic-release, changesets)
Related patterns
Terraform Resource Block Header
Text ProcessingMatch the opening line of a Terraform `resource "type" "name" {` block, capturing the resource type and local name.
Base64 String
Text ProcessingMatch Base64-encoded strings, including proper padding with = and == characters.
C-Style Block Comment
Text ProcessingMatch C-style /* ... */ block comments across multiple lines.
Duplicate Word
Text ProcessingDetects consecutive duplicate words using a backreference.