Improve chatPostprocessor splitString regex #93

Open
opened 2025-01-11 01:39:45 -05:00 by rainbownapkin · 1 comment
rainbownapkin commented 2025-01-11 01:39:45 -05:00 (Migrated from gitlab.com)

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/g

We 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.

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/g` We 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.
rainbownapkin commented 2025-05-02 06:56:35 -04:00 (Migrated from gitlab.com)

This string was modified as of 'd3aa4b8274ab24664d66d8ebb333acd31349e722' in order to accommodate usernames w/ underscores and dashes.

This string was modified as of 'd3aa4b8274ab24664d66d8ebb333acd31349e722' in order to accommodate usernames w/ underscores and dashes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: rainbownapkin/canopy#93
No description provided.