3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

second part of the regexen can be empty

This commit is contained in:
Luke Slater 2013-01-22 12:21:14 +01:00
parent 7d744ef849
commit 5b965657bb

View File

@ -3,7 +3,7 @@ var _ = require('underscore')._;
var regex = function(dbot) {
this.last = {};
this.listener = function(event) {
var q = event.message.valMatch(/^([\d\w\s]*)?:? ?s\/(.+)\/(.+)\/([ig]*)?$/, 5);
var q = event.message.valMatch(/^([\d\w\s]*)?:? ?s\/(.+)\/(.+)?\/([ig]*)?$/, 5);
if(q) {
var flags = q[4],
toMatch = new RegExp(q[2], flags),