Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hpdubs14 opened this issue Mar 30, 2016 · 3 comments
Open

Comments

@hpdubs14
Copy link

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
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Collaborator

therealklanni commented Apr 18, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants