How to return a string if a re.findall finds no match
问题 I am writing a script to take scanned pdf files and convert them into lines of text to enter into a database. I use re.findall to get matches from a list of regular expressions to get certain values from the tesseract extracted strings. I am having trouble when a regular expression can't find a match I want it to return "Error." So I can see that there is a problem. I have tried a handful of if/else statements but I can't seem to get any to notice the None value. from wand.image import Image