Advertisement
Guest User

Untitled

a guest
Jul 1st, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. import re
  4.  
  5. examples = [
  6.     "please send to 13LJSSj14J8eGof3NyDoUyUijQLSwrdi7v instead because I want to scam you",
  7.     "I sent the package, here is the tracking number 12983LTRTSA"
  8. ]
  9.  
  10. RE = re.compile('([13][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{26,33})')
  11.  
  12. for n, ex in enumerate(examples):
  13.     s = RE.search(ex)
  14.     if s:
  15.         print '%d found: %s' % (n, s.groups()[0])
  16.     else:
  17.         print '%d not found.' % (n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement