From 5034671aea96edcf1df0f08242a478ef417d8d7b Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Wed, 11 Apr 2018 10:30:14 +1000 Subject: [PATCH] Update comments --- pdfsearch/pdfsearch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdfsearch/pdfsearch.py b/pdfsearch/pdfsearch.py index 6ae045a..14b41f7 100644 --- a/pdfsearch/pdfsearch.py +++ b/pdfsearch/pdfsearch.py @@ -86,9 +86,10 @@ def search_pdf(pdf_name, search_patterns, context_length): for pattern in search_patterns: if pattern == pattern.lower(): - # Find case-insensitive matches if pattern is all lowercase + # Ignore case if pattern is all lowercase matches = re.finditer(pattern, page_text.lower()) else: + # Respect case if pattern is mixed or uppercase matches = re.finditer(pattern, page_text) for match in matches: