regex better

This commit is contained in:
Luke Slater 2011-08-25 14:18:08 +01:00
parent fed8cb6789
commit a9f2d7fe51

View File

@ -6,8 +6,6 @@ var youAre = function(dbot) {
var num = Math.floor(Math.random()*11); var num = Math.floor(Math.random()*11);
var key = data.message.match(/ is|are ([\d\w\s']*),?\.?/); var key = data.message.match(/ is|are ([\d\w\s']*),?\.?/);
if(num == 1 && key != undefined) { if(num == 1 && key != undefined) {
if(key[1].indexOf('and') !== -1) { if(key[1].indexOf('and') !== -1) {
key[1] = key[1].split('and')[0]; key[1] = key[1].split('and')[0];