Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- response = json.dumps(res)
- data = json.loads(response)
- fulltext = []
- for row in data['hits']['hits']:
- fulltext.append(row['_source']['text'])
- for text in fulltext:
- 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)
- if numbers:
- for contact in numbers:
- print contact
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement