I'm writing a client for the Cyan Chat protocol (http://cho.cyan.com/chat) and all of the usernames are sent to the client as:
X[username]|^1Text
The X prefixing the username is a colour code. Currently I can print out what users say in my richTextBox, but I need a regular expression to find and locate all usernames between brackets.
I have the code to colour the names, I just need a regex to find them. I spent most of yesterday searching for Regex help, and testing it, but nothing that I've tried has seemed to work.
I'm hoping someone here will have some expertise with Regular expressions and can tell me how to do this.
Here is a regex to place the items into groups, such as code, name and description. The assumption is that the code (X) is a digit....(note use IgnoreWhiteSpace option) to include the comments in the regex.
could u pls tell me what tool u use to build up the info like in your post here? Looks neat.
What! You don't believe I do it all by hand? <g>
I have written a program which takes in the regex pattern and text and it outputs the html which can be pasted into the forums post as html code. Its a touch raw right now...but when I get it to where it can handle specifying the regex options, I will post it on my blog and provide a link in the resources page.