Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. response = json.dumps(res)
  2. data = json.loads(response)
  3.  
  4. fulltext = []
  5.  
  6. for row in data['hits']['hits']:
  7. fulltext.append(row['_source']['text'])
  8.  
  9. for text in fulltext:
  10.  
  11. numbers = re.findall(r'((?:+|00)[17](?: |-)?|(?:+|00)[1-9]d{0,2}(?: |-)?|(?:+|00)1-d{3}(?: |-)?)?(0d|([0-9]{3})|[1-9]{0,3})(?:((?: |-)[0-9]{2}){4}|((?:[0-9]{2}){4})|((?: |-)[0-9]{3}(?: |-)[0-9]{4})|([0-9]{7}))', text)
  12.  
  13. if numbers:
  14. for contact in numbers:
  15. print contact
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement