Check the validity of a 10-digit telephone number
APL (Dyalog Unicode), 30 29 bytesSBCS



'^\d{3}(\D*)\d{3}\1\d{4}$'⎕S⍬


It simply ⎕Searches for the PCRE regex and returns a dummy value (the empty numeric list) for each match. If none are found, it returns a single empty numeric list.

Try it online! The effect of printing a list of empty lists is to print two spaces on a line, while the effect of printing an empty list is to print an empty line. Select all contents in the Output field to reveal the spaces, or use this to lead each printed line with → and each space with ·.