I want to match every line from a list, where the word company
appears and is not immediately followed by a ticker symbol. So in the list below, lines 1, 3, and 4 should match, but not lines 2 and 5.
The company was acquired by Xerox (NYSE: XRX) for $225 million on May 6, 2014.
The company (NASDAQ:EPOC) was acquired by Athenahealth (NASDAQ:ATHN) for $293 million in cash on January 7, 2013.
The company is acquired by New Mountain Capital for $225 million through an LBO on December 18, 2015. FS Investments provided unitranche term loan financing to support the acquisition by New Mountain Capital.
The company was acquired by HTC Global Services for $97.5 million on December 18, 2014.
The company (NYS: EVHC) was acquired by Kohlberg Kravis Roberts through a $9.9 billion public-to-private LBO on October 11, 2018. The debt financing for the acquisition includes $5.05 billion term loan B, $2.15 billion of high-yield bond and $850 million of loan financing.
I'm using the following code in a loop:
obj = re.match("company\s+(?!\([A-Z]+:\s*[A-Z]+\))", line, flags=0)
if obj:
# do something
where line is a line similar to those in the list above. It works when I test but not in Python. Any kind souls care to point out the error of my ways?