Skip to content

Instantly share code, notes, and snippets.

@cberner
Last active August 29, 2018 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cberner/2c0c42e05b09d0dc30973bac731ecec1 to your computer and use it in GitHub Desktop.
Save cberner/2c0c42e05b09d0dc30973bac731ecec1 to your computer and use it in GitHub Desktop.
[
{
"id": 1,
"name": "Alice Smith",
"email": "asmith@gmail.com",
"phone": "1-510-111-2233 x05"
},
{
"id": 2,
"name": "Mr. Bob Jones",
"email": "bob@jones.com",
"phone": "(415)444-5566"
},
{
"id": 3,
"name": "Dr. Cathy Aberforth",
"email": "cathy@outlook.com",
"phone": "+1-541-999-0011"
},
{"id": 4, "name": "Dave Roberts", "email": "droberts@yahoo.com", "phone": "800.555.6677"}
]
@node0ne
Copy link

node0ne commented Aug 29, 2018

grep -o '\(\(([0-9]\{3\})\|[0-9]\{3\}\)[.-]\?\)\{2\}[0-9]\{4\}' people.json | tr -d '(' | tr '.)' - > people_phoneOnly.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment