From d622bf2c71540fb241eb6be78c0ece1c692ef740 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 20 Sep 2017 12:53:03 +0000 Subject: [PATCH] fts: add [] to regex to the start/end of word git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3956 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- fts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fts.php b/fts.php index 1d5c371..87c3cba 100644 --- a/fts.php +++ b/fts.php @@ -148,9 +148,9 @@ class fts $operator[$key] = "NOT REGEXP"; else $operator[$key] = "REGEXP"; - $value[$key] = "(^|[<> \(\"',.;/:!?\r\n])". + $value[$key] = "(^|[<> \[\]\(\"',.;/:!?\r\n])". preg_quote ($token). - "([<> \)\"',.;/:!?\r\n]|$)"; + "([<> \[\]\)\"',.;/:!?\r\n]|$)"; } return array ("operator"=>$operator, "value"=>$value); }