Python Create Regex Pattern From Lines