def obtain_serial_number(show_ver):
 match = re.search('Processor board ID (.+)', show_ver)
 if match:
  return match.group(1).strip()
 else:
  return None

def obtain_serial_number ( show_ver ) : match = re . search ( 'Processor board ID (.+)' , show_ver ) if match : return match . group ( 1 ) . strip ( ) else : return None
example string from cisco ios: processor board id ftx1000008x return the serial_number .