Browse Source

regex battle

master
calexil 2 years ago
parent
commit
e3ca62292a
2 changed files with 14 additions and 1 deletions
  1. 7
    0
      bot.js
  2. 7
    1
      bot.js~

+ 7
- 0
bot.js View File

@@ -9,12 +9,19 @@ const bodyParser = require('body-parser');
// Message Array
const responseObject = {
"test": "It worked!",
"best girl?": "Big Band.",
"best girl": "Big Band.",
"best grill": "Big Band.",
"best grill?": "Big Band.",
"best gurl": "Big Band.",
"best gurl?": "Big Band.",
"best booty": "Squigly, Duh.",
"best booty?": "Squigly, Duh.",
"hi": "Hello there, I'm a dumb bot written by [@calexil#9270](https://github.com/calexil) and [@Timberius#8180](https://github.com/TimboKZ) , you can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md",
"commands": "You can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md"
};

console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/g, "Big Band."));
// Call the web page with express
app.use(express.static('public'));

+ 7
- 1
bot.js~ View File

@@ -9,6 +9,12 @@ const bodyParser = require('body-parser');
// Message Array
const responseObject = {
"test": "It worked!",
"best girl?": "Big Band.",
"best girl": "Big Band.",
"best grill": "Big Band.",
"best grill?": "Big Band.",
"best gurl": "Big Band.",
"best gurl?": "Big Band.",
"best booty": "Squigly, Duh.",
"best booty?": "Squigly, Duh.",
"hi": "Hello there, I'm a dumb bot written by [@calexil#9270](https://github.com/calexil) and [@Timberius#8180](https://github.com/TimboKZ) , you can see my commands here: https://github.com/calexil/BansheeBot/blob/master/Commands.md",
@@ -44,7 +50,7 @@ client.on('ready', () => {
if (!musicChannel) console.error('Could not find music channel!');

console.log('I am ready!');
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/gi, "Big Band."));
console.log("best girl?".replace(/best g(ir|ri|ur)l+\??/g, "Big Band."));
});

// Reply to keywords in the array

Loading…
Cancel
Save