Improve chatPostprocessor splitString regex #93
Labels
No labels
Bug
Cleanup/Refactor
Core Feature
Documentation
Feature
Performance Improvement
Security Improvement
UX/Accessibility
Unreproducable Bug
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: rainbownapkin/canopy#93
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Improve regex for splitting strings in chatPostprocessor.
Currently it checks for word boundaries on words, and non-word boundaries in whitespace, save for file seperator chars:
/(?<!␜)(?=\w)\b|(?<=\w)\b|(?=\s)\B|(?<=\s)\B/gWe should instead ignore file seperators, while seperating words by word boundries, and everything else at any time except for pairs of non-word chars (for example ##).
This will ensure ##[bill]## splits as ##|[bill]|##, as it will keep up to two of the same characters together outside of words.
This string was modified as of 'd3aa4b8274ab24664d66d8ebb333acd31349e722' in order to accommodate usernames w/ underscores and dashes.