def _strip_postfix(req):
 match = re.search('^(.*?)(?:-dev|-\\d.*)$', req)
 if match:
  req = match.group(1)
 return req

def _strip_postfix ( req ) : match = re . search ( '^(.*?)(?:-dev|-\\d.*)$' , req ) if match : req = match . group ( 1 ) return req
strip req postfix .