From 77b3f0990f4e3d68cc7a87cb715591ca393e6010 Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 23 Oct 2016 18:15:14 +0200 Subject: [PATCH] case insesitive --- static-hugo-search/search.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static-hugo-search/search.php b/static-hugo-search/search.php index 6dee5d5..e3d6b0b 100644 --- a/static-hugo-search/search.php +++ b/static-hugo-search/search.php @@ -69,11 +69,12 @@ if(isset($_POST['query'])) { if($limit > 30) break; $stream = new SplFileObject($file); - $grepped = new RegexIterator($stream, '/'.$searchStr.'/'); + $grepped = new RegexIterator($stream, '/'.$searchStr.'/i'); foreach($grepped as $found) { $_text = $file; - + # this search for a headline tag and the result will be used as + # the result text in the search results $headlines = new RegexIterator($stream,"/

([^<]+)<\/h2>/"); foreach($headlines as $headline) { $_text = trim($headline); -- 2.39.5