Unfortunately, I'm pretty sure that your solution won't account for punctuation that might follow the nickname. For instance, I think that it will fail to highlight the message if it contains "segphault:" instead of "segphault ". It could also fail for messages that have the user's nick at the very end of the string.
I've been thinking about how to solve this too, and I'm having a hard time coming up with a viable solution that doesn't involve a regular expression.
Thanks for working on this!
Unfortunately, I'm pretty sure that your solution won't account for punctuation that might follow the nickname. For instance, I think that it will fail to highlight the message if it contains "segphault:" instead of "segphault ". It could also fail for messages that have the user's nick at the very end of the string.
I've been thinking about how to solve this too, and I'm having a hard time coming up with a viable solution that doesn't involve a regular expression.