I am trying to remove the table descriptions from the following text so that only the non table text remains. I have been playing with regex101.com but can't seem to find pattern that actually does this (it always takes the whole section). What am I missing here?
TABLE 37-1 Text over multiple lines that describes the table (.pdf)
Non table text.
TABLE 37-2 Text over multiple lines that describes the table (.pdf)
import re
text = 'string of text in block quotes above'
processed_text = re.sub(r'(TABLE)(.|\n)*(\(\.pdf\))', r'', text)
print (processed_text)