From e75641c7002f783371e26a81497510b309f3b6fe Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Tue, 17 Apr 2018 12:17:50 +1000 Subject: [PATCH] Use 're.IGNORECASE' flag instead of 'lower()' string method --- pdfsearch/pdfsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfsearch/pdfsearch.py b/pdfsearch/pdfsearch.py index 35bfd4e..d07743c 100644 --- a/pdfsearch/pdfsearch.py +++ b/pdfsearch/pdfsearch.py @@ -87,7 +87,7 @@ def search_pdf(pdf_name, search_patterns, context_length): for pattern in search_patterns: if pattern == pattern.lower(): # Ignore case if pattern is all lowercase - matches = re.finditer(pattern, page_text.lower()) + matches = re.finditer(pattern, page_text, re.IGNORECASE) else: # Respect case if pattern is mixed or uppercase matches = re.finditer(pattern, page_text)