def scrubStr(str):
 groups = re.findall(GROUP_RGX, str)
 for group in groups:
  if group[0]:
   sub = group[0]
  else:
   sub = group[1].split(':')[1]
   sub = sub.replace('-', ' ')
  str = re.sub(SUB_RGX, sub, str, 1)
 return str

def scrubStr ( str ) : groups = re . findall ( GROUP_RGX , str ) for group in groups : if group [ 0 ] : sub = group [ 0 ] else : sub = group [ 1 ] . split ( ':' ) [ 1 ] sub = sub . replace ( '-' , ' ' ) str = re . sub ( SUB_RGX , sub , str , 1 ) return str
the purpose of this function is to scrub the weird template mark-up out of strings that veekun is using for their pokedex .