diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/factoids.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/data/rbot/plugins/factoids.rb b/data/rbot/plugins/factoids.rb index aeb6557f..3192aa00 100644 --- a/data/rbot/plugins/factoids.rb +++ b/data/rbot/plugins/factoids.rb @@ -331,7 +331,9 @@ class FactoidsPlugin < Plugin # When looking for words we separate them with # arbitrary whitespace, not whatever they came with pre = words.map { |w| Regexp.escape(w)}.join("\\s+") - return Regexp.new("\\b#{pre}\\b", true) + pre << '\b' if pre.match(/\b$/) + pre = '\b' + pre if pre.match(/^\b/) + return Regexp.new(pre, true) end def facts(m, params) |