Back to Library
DevOps

Conventional Commit Message

Validate conventional commit subject lines with optional scope.

Pattern
^(feat|fix|docs|chore|refactor|test|perf)(\([a-z0-9-]+\))?: .{1,72}$

Test Cases

feat(api): add health endpoint Match
feature add health endpoint No Match

Related Blog Guides

Enforcing Password Complexity with Lookaheads

Don't chain five separate if-statements. Use a single regex with positive lookaheads to enforce password rules like length, digits, and special characters.

Username & Handle Validation Regex: Safer Patterns by Platform

Design robust username and social handle validators with clear boundaries, Unicode tradeoffs, and platform-specific constraints.

Regex Patterns for Log Parsing: 7 Production-Ready Recipes

Use battle-tested regex patterns to extract timestamps, status codes, trace IDs, and error messages from noisy application logs.

Try it Live

Test and customize this pattern in our interactive editor

Open in Editor
About Blog Patterns Cheatsheet GitHub

© 2026 TestRegex.