From aa632d9e6777bc13501af3e97b5c1e6a33eb6887 Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Sat, 24 Jan 2015 23:46:08 +0100
Subject: [PATCH] better search with words for !get

---
 lib/commands/get.pm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/commands/get.pm b/lib/commands/get.pm
index eaccba7..2273f0e 100644
--- a/lib/commands/get.pm
+++ b/lib/commands/get.pm
@@ -27,14 +27,15 @@ sub exec {
     my $req;
     my $rows;
 
-    my @words = ($msg =~ /(?:^| )([a-zA-Z0-9_-]+)/g);
+    my @words = ($msg =~ /(?:^| )([\S]+)/g);
+    print "@words";
 
     if (not defined $last_req or $msg ne $last_req) {
         my $dbh = utils::db::get_session;
 
         my @words_param;
-        while ($msg =~ /(?:^| )([a-zA-Z0-9_-]+)/g) {
-            unshift @words_param, '%'.$1.'%';
+        foreach (@words) {
+            unshift @words_param, '%'.$_.'%';
         }
 
         my $words_sql;
-- 
GitLab