I'm having trouble matching strings in Python. What I'm trying to do is look for lines in documents like this and try to match each line to specific phrases. I'm reading in all the lines and parsing with Beautfiul soup into stripped strings, then iterating through a list of all the lines in the document. From there, I use the following code to match for the specific strings:
if row.upper() == ("AUDIT COMMITTEE REPORT" or "REPORT OF THE AUDIT COMMITTEE"):
print("Found it!")
if "REPORT" in row.upper():
print ("******"+row.upper()+"******")
When the code runs, I get the following output:
******COMPENSATION COMMITTEE REPORT******
******REPORT OF THE AUDIT COMMITTEE******
******REPORTING COMPLIANE******
******COMPENSATION COMMITTEE REPORT******
******REPORT OF THE AUDIT COMMITTEE******
The program never finds it when the string is being checked for equality, but when asked if a portion of it is in the string, it's able to find it without trouble. How does string matching working in Python, s.t. these events are occurring, and how can I fix it so that it'll make those exact phrases?
EDIT: Another note that should be made is that these documents are quite large, some exceeding 50 pages easily, and checking if the string is just in the row is not enough. It needs to be an exact match.