Open Asartea opened 11 months ago
That sounds cool, I'm not sure how much more complicated it will make the points regex
@TheOdinProject/maintainers what do we think?
Instead of using each of the different points regex individually in the awardPoints.regex
, we could create a new variable so that the "main" regex isn't as long:
const starRegex...
const plusRegex...
const doublePointsPlusRegex...
const givePointsRegex = `(${doublePointsPlusRegex}|${plusRegex}|${starRegex})`
Then just check whether for "userRegex followed by givePointsRegex | givePointsRegex followed by userRegex". Doesn't really make it less complicated, but maybe a little easier to read?
`(?<!\\S)(${userRegex}\\s?${givePointsRegex}|${givePointsRegex}\\s?${userRegex})(?!\\S)`
The above sounds very reasonable. I like the idea of supporting pre-increment.
Complete the following REQUIRED checkboxes:
[x] I have thoroughly read and understand The Odin Project Contributing Guide
[x] The title of this issue follows the
command name: brief description of request
format, e.g./help: add optional @user parameter
The following checkbox is OPTIONAL:
1. Description of the Feature Request:
Sometimes people use the wrong form of increment (++prefix rather than postfix++), when trying to give someone points, which doesn't work. It would be neat if this also worked
2. Acceptance Criteria:
++@example
works the same as@example++
3. Additional Information: