Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. alphanumeric = compile('^[wd ]+$')
  2.  
  3. Tomkiewicz Zigomalas Andrade Mcwalters
  4.  
  5. >>> an_re = r"(d+[A-Z])|([A-Z]+d)[dA-Z]*"
  6. >>> re.search(an_re, '12345', re.I) # not acceptable string
  7. >>> re.search(an_re, 'abcd', re.I) # not acceptable string
  8. >>> re.search(an_re, 'abc1', re.I) # acceptable string
  9. <_sre.SRE_Match object at 0x14153e8>
  10. >>> re.search(an_re, '1abc', re.I)
  11. <_sre.SRE_Match object at 0x14153e8>
  12.  
  13. (?=.*[a-zA-Z])(?=.*[0-9])^[wd ]+$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement