Scraping fuzzy data from pdf

Continuing the discussion from How to fuzzy search a text file and return the relevant text?:

how to get that relevant text and store it to a string variable?