I am using PyMuPDF from the fitz package to search and highlight words in a PDF. How to I find a word with an apostrophe in it? In my example code, text_instances will be empty. If you search for 'her' or "'", then text_instances will not be empty. Not sure what the problem is with the two strings concatenated.
Here is my example code:
import fitz
# READ IN PDF
doc = fitz.open("FILE.pdf")
page = doc[0]
text = "her's"
text_instances = page.searchFor(text)