apaleslimghost / slack-pokedex

3 stars 3 forks source link

Fix the scunthorpe error #7

Open keithamus opened 8 years ago

keithamus commented 8 years ago

In detecting pokemons, this bot suffers from the scunthorpe problem. E.g. somewhere detects mew.

The trick is to add \b around the regexp that detects these. I've done it in my revision here: https://gist.github.com/keithamus/eb80d5e99a6c7457bfaa77ab55f03090/revisions. You should amend your gist and republish to fix this issue!

apaleslimghost commented 8 years ago

i'd possibly just put \b at the start of the regex. with the current regex it accidentally supports plurals and it would be a lot more work to support them properly.

keithamus commented 8 years ago

Sounds like a plan 👍