def check_id(ID):
 return (re.match(u'^[A-Za-z_][A-Za-z0-9_\\.\\-]*$', ID) is not None)

def check_id ( ID ) : return ( re . match ( u'^[A-Za-z_][A-Za-z0-9_\\.\\-]*$' , ID ) is not None )
raises a ~astropy .