You may also check HTQL. It supports regular expression search of tokens. An example to search for state and zip from US address is:
a=htql.RegEx();
a.setNameSet('states', states);
a.reSearchList(address.split(), r"&[ws:states]<,>?<\d{5}>", case=False)