Code
Match a PascalCase identifier
Match class-style names like UserAccount or HttpClient.
Pattern
Regular expression
\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\bHow it works
Starts with a capital letter followed by lowercase/digits, then one or more additional capitalized segments. Excludes single-word capitals like `User`.
Matches
- ▸UserAccount
- ▸HttpClient
- ▸MyClass123
Non-matches
- ▸User (single word)
- ▸userAccount (starts lower)
Language snippets
JavaScript
const re = /\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\b/g;Python
re.findall(r"\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\b", text)Go
re := regexp.MustCompile(`\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\b`)Java
Pattern.compile("\\b[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)+\\b")