Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 12-1234 *string*
- 12 1234 *string*
- 12 123 *string*
- 12-1234 *string*
- a = re.compile("^d{0,2}[- ]d{0,4}$")
- if a.match(dbfull_address):
- continue
- ^d{0,2}[- ]d{0,4}$
- reobj = re.compile(r"^[d]{0,2}[s-]+[d]{0,4}.*?$", re.IGNORECASE | re.MULTILINE)
- Options: dot matches newline; case insensitive; ^ and $ match at line breaks
- Assert position at the beginning of a line (at beginning of the string or after a line break character) «^»
- Match a single digit 0..9 «[d]{2}»
- Exactly 2 times «{2}»
- Match the regular expression below and capture its match into backreference number 1 «(.|*)?»
- Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
- Match either the regular expression below (attempting the next alternative only if this one fails) «.»
- Match the character “.” literally «.»
- Or match regular expression number 2 below (the entire group fails if this one fails to match) «*»
- Match the character “*” literally «*»
- Match the regular expression below and capture its match into backreference number 2 «([d]{2})?»
- Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
- Match a single digit 0..9 «[d]{2}»
- Exactly 2 times «{2}»
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement