regex: string with optional parts,"re.search('^(.*?)(Arguments:.*?)?(Returns:.*)?$', s, re.DOTALL)"