Skip to content

Instantly share code, notes, and snippets.

@timabell
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timabell/07b3a23f8f21baafb508 to your computer and use it in GitHub Desktop.
Save timabell/07b3a23f8f21baafb508 to your computer and use it in GitHub Desktop.

about

simples

UK Phone Number

(\+44)? 0[0-9]{4} [0-9]{7,10} (ext [0-9]{1,3})?

Windows Domain Login - DOMAIN\USER

[A-Z]{1,10}\\[A-Z_.]{1,10}

UK NI Number

[A-Z]{2} [0-9]{2} [0-9]{2} [0-9]{2} [A-Z]

Full Name with Title

(Mr|((Mrs|Miss|Ms)|Dr)(\.?)) ($"NamesFirst.txt") ($"NamesLast.txt")

DX Address

First bit nabbed from pre-canned "Company Name"

(Re|Ad|Par|Tru|Thru|In|Bar|Cip|Dop|End|Em|Fro|Gro|Hap|Kli|Lom|Mon|Qwi|Rap|Sup|Sur|Tip|Tup|Un|Up|Var|Win|Zee)(ban|cad|dud|dim|er|frop|glib|hup|jub|kil|mun|nip|peb|pick|quest|rob|sap|sip|tan|tin|tum|ven|wer|werp|zap)(il|ic|im|in|up|ad|ack|am|on|ep|ed|ef|eg|aqu|ef|edg|op|oll|omm|ew|an|ex|pl)?(icator|or|ar|ax|an|ex|istor|entor|antor|in|over|ower|azz)(([ -]?Pro|Duplex|Multi){0}) (Direct|WorldWide|Holdings|International||) (|Inc|Company|Group|Corp.)?
DX [0-9]{7,9}
($"UKCity.txt")

Python

Short code from other column - London => LON

LocationFullName[:3].upper()

(watch out for Poole!!)

concat nullable columns

http://gis.stackexchange.com/a/112858/449

def main(config):
    return concat(colA, colB, colC)
    
def concat(*args):
    # http://gis.stackexchange.com/a/112858/449
    sep = " "
    nonnull_args = [str(arg).strip() for arg in args if arg]  # Filter NULLs
    good_args = [arg for arg in nonnull_args if arg]          # Filter blanks
    return sep.join(good_args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment