Mobile with ninth digit
- Input
- (11) 99999-9999
- Expected output
- match
Area code 11 in parentheses, a space, the ninth digit 9, four digits, a hyphen and four more: the full 11 digits match the complete mobile shape.
brazilian phone regex
A Brazilian phone number in valid format has a 2-digit area code followed by 8 digits (landline) or 9 digits (mobile, with the ninth digit). This preset tests exactly that count, not whether anyone answers on the other end.
Area code 11 in parentheses, a space, the ninth digit 9, four digits, a hyphen and four more: the full 11 digits match the complete mobile shape.
10 digits in a row, no parentheses or hyphen: since every other piece of the pattern is optional, a 2-digit area code plus 8 digits also passes.
The pattern only accepts a hyphen or nothing between the last two 4-digit blocks; a space where the hyphen goes breaks the match even with the right digit count.
Yes. The idea is to let you build the expression, apply flags and inspect matches in real time, which is especially useful for debugging, learning and fine-tuning patterns.
No. It measures format: digit count, area code position and ninth digit position. A disconnected line, a recycled area code or a number that was never assigned can all pass the format check and still not exist; confirming existence requires sending an SMS, a call, or an integration with the carrier.
Because `\d{2}` only requires 2 digits, without checking whether the value falls between 11 and 99. That is the gap between validating format (how many digits, in what position) and validating domain (which area codes ANATEL actually assigned), and this preset only solves the first one.
Yes, because the ninth digit is optional (`9?`): without it the pattern accepts the 10-digit landline, with it the 11-digit mobile. A mobile-only detector would need to swap that optional `9?` for a mandatory `9`.
Everything runs locally in your browser. Nothing is sent to a server.