Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do geographical coordinates have a standard layout? I'd expect that you have to look at your particular data for cases like this.

Something like IMEI should be pretty easy, if Wikipedia [0] is to be trusted (e.g. in Python):

    # Matches IMEI and IMEISV
    imei_pattern = re.compile(r"\d{2}-\d{6}-\d{6}-\d\d?")
You could write a big monster pattern that sets up capture groups for all the different TAC and Check Digit variants, but why bother? Just slice off what you need from the result after matching.

0: https://en.wikipedia.org/wiki/International_Mobile_Equipment...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: