Validationflags: g
Twitter / X Handle
Match Twitter/X @handles — 1 to 15 characters of letters, digits, or underscores preceded by @.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
@([A-Za-z0-9_]{1,15})\b (flags: g)Raw source: @([A-Za-z0-9_]{1,15})\b
How it works
@ matches the literal at-sign. The capturing group ([A-Za-z0-9_]{1,15}) captures 1–15 characters of the Twitter username alphabet. \b prevents partial matches inside longer words.
Examples
Input
Follow @jack and @TwitterDev for updatesMatches
@jack@TwitterDev
Input
@user_123 liked your postMatches
@user_123
Input
no handles hereNo match
—Common use cases
- •Social media mention extraction
- •Notification routing in community platforms
- •Influencer campaign analytics
- •Content moderation pipelines
Related patterns
Username
ValidationValidate usernames that are 3–16 characters long and contain only letters, digits, underscores, and hyphens.
Alphanumeric Only
ValidationMatch strings containing only letters (A–Z, a–z) and digits (0–9), with no spaces or special characters.
Password (No Special Chars)
ValidationValidate passwords requiring at least one lowercase, one uppercase, one digit, and minimum 8 characters — no special characters required.
IBAN (International Bank Account Number)
ValidationValidate IBAN bank account identifiers: 2-letter country code, 2 check digits, 11–30 alphanumerics.