Build, test, and debug regular expressions
Matches Brazilian-style phone numbers with 10 or 11 digits in two formats: with a parenthesized area code and hyphen, e.g. (11) 1234-5678 or (11) 91234-5678, or as plain digits like 11912345678. It supports both 8-digit landlines and 9-digit mobile numbers starting with 9. Note that the ^ anchor only applies to the first alternative and $ only to the second due to alternation precedence, which may cause unintended partial matches.