Firstly you’d need to look at extracting users from the text. This looks like a regular expression, starting with @ and continuing to the first non username permitted character (e.g. a space character).
Once you have this, you can search System.User for a someone with a matching Name attribute (beware of case sensitivity).
Once you have that, you should be able to create a Message object and link it to your User (assuming that is how you are planning on sending messages). Make sure your Message object has sensible security so one user can create and the other can read.
Hope this helps.