def generic_ospf_parser(pattern, ospf_data):
 a_match = re.search(pattern, ospf_data)
 if a_match:
  return a_match.group(1)
 return None

def generic_ospf_parser ( pattern , ospf_data ) : a_match = re . search ( pattern , ospf_data ) if a_match : return a_match . group ( 1 ) return None
takes a generic regular expression pattern that has a group(1) match pattern and returns this else returns none .