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 login

Matches

  • feat(auth): add OAuth2 login

Input

fix!: correct null pointer in parser

Matches

  • fix!: correct null pointer in parser

Input

random commit message

No match

Common use cases

  • Git commit-msg hooks
  • Automated changelog generation
  • PR title validation in CI
  • Release tooling (semantic-release, changesets)