Splitting string ID code into various parts
1
I have a series of identification codes that I need to split out. The format of these codes is [region(letter)][district(number)] - [place(number)][subdistrict(letter)] . An example of some codes includes S22-201 , TT100-12 , and V6-1B . Often there is no subdistrict, and all points fall within the same larger district (so no As or Cs or whatever at the end of the string. I can do parts of it, like splitting at the hyphen. !Original_ID!.split('-')[0] and then extracting the district !Split_ID![1:3] But it seems like two steps for this are unnecessary, and only works when I know the specific number of characters in the string, which isn't realistic for a large data set. I'd like to be able to grab each piece at once: letters on the left of the hyphen numbers on the left of the h...