Open hpdubs14 opened 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.
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.
Feel free to submit a PR! Please make sure to add a test case that covers this scenario.
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.