Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- if __name__ == '__main__':
- text = "Inbox - blablabla@gmail.com"
- match = re.findall('- ([^@]+)', text)
- print '1:', match[0]
- match = re.findall('- [^@]+', text)
- print '2:', match[0]
- match = re.search('- ([^@]+)', text)
- print '3:', match.group(0)
- print '4:', match.group(1)
- match = re.search('- [^@]+', text)
- print '5:', match.group()
- #---------
- 1: blablabla
- 2: - blablabla
- 3: - blablabla
- 4: blablabla
- 5: - blablabla
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement