Test, validate and match regular expressions
Matches Guatemalan phone numbers consisting of an optional 3-digit code (typically country code 502 or area code) followed by two 4-digit groups, e.g. '502 1234 5678' or '1234-5678'. The pattern requires non-word delimiter characters (spaces, dashes, parentheses) at both ends and optionally between digit groups, so it targets phone numbers bounded by separators within larger text. With the global flag, it extracts all such occurrences from a string.