Dumb RichTextBox question

Posted by John Williams on Stack Overflow See other posts from Stack Overflow or by John Williams
Published on 2010-04-04T21:19:07Z Indexed on 2010/04/04 21:23 UTC
Read the original article Hit count: 191

Filed under:
|
|

I need to get a list of tags in a text, make their contents bold, and remove them. Can't figure out how to make it.

E.g. with the following input:

foo [b]bar[/b]

The result should be:

foo bar

I use the following code to extract the tags:

 Dim matches = Regex.Matches(OriginalRich.Text, String.Format("(\[{0}\])(.*?)(\[/{0}\])", tag), RegexOptions.IgnoreCase Or RegexOptions.Compiled)

Any help would be appreciated.

© Stack Overflow or respective owner

Related posts about regex

Related posts about richtextbox