Extract phone numbers
Jump to navigation
Jump to search
[keisti]
grep -h -E -o "(?:(?:\+?([1-9]|[0-9][0-9]|[0-9][0-9][0-9])\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([0-9][1-9]|[0-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?" -R >> phones.txt
Filtravimas pagal šalį[keisti]
Country code: 91 (australia), 4 nusako, kad tai mobilus rysys ir dar 8 skaiciai nurodo lokalu numeri.
grep -E "^614[0-9]{8}$" phones.txt > filtered.txt