I am interested in extracting some information from some PDF files that look like this. I only need the information at pages 2 and after which looks like this:
- (U) country: On [date] [text]. (text in brackets)
This means it always starts with a number a dot a country and finishes with brackets which brackets may also go to the next line too.
My implementation in python is the following:
- use pdfminer extract_text function to get the whole text.
- Then use re.findall function in the whole text using this regex
^\d{1,2}\. \(u\) \w+.\w*.\w*:.* on \d{1,2} \w+.*$with the re.MULTILINE option too.
I have noticed that this extracts the first line of all the paragraphs that I am interested in, but I cannot find a way to grab everything until the end of the paragraph which is the brackets (.*).
I was wondering if anyone can provide some help into this. I was hoping I can match this by only one regex. Otherwise I might try split it by line and iterate through each one.
Thanks in advance.