ajacksified / hubot-plusplus

Welcome to Hubot, where the points don't matter
MIT License
59 stars 100 forks source link

Cannot erase any "thing" that has -- or ++ included in the string. #64

Open hpdubs14 opened 8 years ago

hpdubs14 commented 8 years ago

You cannot erase a record of the "thing" if it contains contains the any of the points trigger patterns.

If a user enters the command hubot user -------------------------, it will create a new thing record with points.

This command hubot erase user ----------------------- will create another thing with points instead of erasing that record.

hpdubs14 commented 8 years ago

Does this work better for the regex by separating out the delimiter matching pattern from the username matching pattern? This wouldn't work if the username included the colon but I'm not sure if that is actually an acceptable format in most cases.

^([\s\w'@.\-]*)[:|\s?].*(\+\+|--|—)(?:\s+(?:for|because|cause|cuz|as)\s+(.+))?

This also manages the cases where someone inputs +++++++++ or -------- for extreme likes/dislikes.

therealklanni commented 8 years ago

We should allow for the semicolon, because Slack (possibly other plaforms) automatically insert it, so it makes it easier for people if they don't have to worry about removing it.

therealklanni commented 8 years ago

Feel free to submit a PR! Please make sure to add a test case that covers this scenario.