Needs review
Project:
Mentions
Version:
8.x-1.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2019 at 04:12 UTC
Updated:
28 Feb 2023 at 16:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
destinationsound commentedComment #3
markwittens commentedUsernames with spaces are not yet detected properly, the attached patch fixes this issue.
Comment #4
markwittens commentedComment #5
sreenivasparuchuri commentedI have usernames which contain hyphens(-) and dots(-), how to handle this, is there any way to make that pattern configurable
Comment #6
nuezThe patch in #3 doesn't really work. In fact user names with spaces I think will be a difficult story.
Imagine finding a user name in the following phrase:
"The @quick brown fox jumps over the lazy dog"
If the user name is quick, it would be easy. However the algorithm would have to match all possible matches after the @ sign, e.g.
- quick
- quick brown
- quick brown fox
- quick brown fox jumps.
There might be a user called 'quick brown fox'. The only thing you know is the maximum length of the user name, and you can limit the search to that amount of characters.
Comment #7
ivnishComment #11
robpowellHow about we go with matching anything between the prefix and suffix? This change in essence makes the pattern
(?:\[~)([^\]]+)\].This will match periods, hyphens and spaces.
Comment #12
robpowell