regex - RegExp C# and richtextbox -


I'm trying to do the following:

1) To match all the strings Using the regex, the following pattern "@username" & lt; & Lt; I get the text to be parsed with rich text boxes and to paint those patterns, @ ([A-z09 _-]) {4,20}

2) Have done "@ Someone in Color"

3) They are clickable and clicked to insert the clicked string in the text box (only when this is done in many codes And it is possible without libraries)

Well, basically this .. any help is appreciated :) 'Cheers :)

Use regexp to search for all the events of "@username", and store them in the archive Then repeat through this collection and do this:

  int startpos = 0; if ((startpos = richTextBox1.Find (name)) gt; 0) {richTextBox1.SelectionStart = startpos ; RichTextBox1.SelectionLength = name.Length; richTextBox1.SetSelectionLink (true);}  

Note that uses the expanded rich textbox found here :. (SetSelectionLink Vanilla Richtexbox Truth is not in class.)


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -