regular expression back references

Andrew Dalke adalke at
Sat Aug 9 04:40:27 CEST 2003

Clay Shirky
>     # use regexes to see what to split on
>     if":", new_address):

or use
    if ":" in new_address:

>     elif"-", new_address):
>         new_list = new_address.split("-")
>     elif".", new_address):
>         new_list = new_address.split(".")

and include a
        raise Exception("I have no idea what you're asking for")

and maybe some ValueError catching in the int call.


More information about the Python-list mailing list