Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. 12-1234 *string*
  2.  
  3. 12 1234 *string*
  4.  
  5. 12 123 *string*
  6.  
  7. 12-1234 *string*
  8.  
  9. a = re.compile("^d{0,2}[- ]d{0,4}$")
  10.  
  11. if a.match(dbfull_address):
  12. continue
  13.  
  14. ^d{0,2}[- ]d{0,4}$
  15.  
  16. reobj = re.compile(r"^[d]{0,2}[s-]+[d]{0,4}.*?$", re.IGNORECASE | re.MULTILINE)
  17.  
  18.  
  19.  
  20. Options: dot matches newline; case insensitive; ^ and $ match at line breaks
  21.  
  22. Assert position at the beginning of a line (at beginning of the string or after a line break character) «^»
  23. Match a single digit 0..9 «[d]{2}»
  24. Exactly 2 times «{2}»
  25. Match the regular expression below and capture its match into backreference number 1 «(.|*)?»
  26. Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
  27. Match either the regular expression below (attempting the next alternative only if this one fails) «.»
  28. Match the character “.” literally «.»
  29. Or match regular expression number 2 below (the entire group fails if this one fails to match) «*»
  30. Match the character “*” literally «*»
  31. Match the regular expression below and capture its match into backreference number 2 «([d]{2})?»
  32. Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
  33. Match a single digit 0..9 «[d]{2}»
  34. Exactly 2 times «{2}»
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement