I\'m trying to extract any jabber accounts (emails) using regex from this page.
I\'ve tried using regex:
\\w+@[\\w.-]+|\\{(?:\\w+, *)+\\w+\\}@[\\w.-]+
Try this one:
reg_emails=r'^((([0-9a-zA-Z]+)[\_\.\-])*([0-9a-zA-Z]+))@((([0-9a-zA-Z]+)[\_\.\-])*([0-9a-zA-Z]+))\.((([0-9a-zA-Z]+)[\_\.\-])*([0-9a-zA-Z]+))$'
This might work:
[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+
p = re.compile(ur'[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+', re.MULTILINE | re.IGNORECASE)
test_str = r'...'
re.findall(p, test_str)
See example.
# -*- coding: utf-8 -*-
s = '''
...YOUR HTML page source code HERE..........
'''
import re
reobj = re.compile(r"\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}\b", re.IGNORECASE)
print re.findall(reobj, s.decode('utf-8'))
[u'skypeman@jabbim.cz', u'sonics@creep.im', u'voxis_team@lsd-25.ru', u'voxis_team@lsd-25.ru', u'adhrann@jabbim.cz', u'jabberwocky@jabber.systemli.org']