I\'m having a problem with a regex I created. My company searches for errors in an error file and tries to match the file to a set of possible strings. If one of the strings
Yes, use
r"(?m)^.*?(is a duplicate for this vendor|Duplicate transaction detected)"
See proof. The (?m)^.*?
part makes the pattern match at the start of each line since the caret matches the line start position and the .*?
matches any zero or more characters other than linebreaks, but as few as possible.