We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26c1980 commit 356e574Copy full SHA for 356e574
193-valid-phone-numbers.sh
@@ -0,0 +1,10 @@
1
+# Read from the file file.txt and output all valid phone numbers to stdout.
2
+awk '/^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$/' file.txt
3
+
4
+# another
5
6
+grep -P '^(\(\d{3}\) |\d{3}-)\d{3}-\d{4}$' file.txt
7
8
9
10
+sed -n -r '/^([0-9]{3}-|\([0-9]{3}\) )[0-9]{3}-[0-9]{4}$/p' file.txt
0 commit comments