Test, validate and match regular expressions
This regex matches the beginning of a commit message type, such as 'feat' or 'fix', by capturing a word after optional leading whitespace at the start of a line. It is useful for parsing conventional commit messages to extract the commit type for validation or tooling like commitizen.