'Define regex
Dim regExp As RegularExpressions.Regex

'Italic text
regExp = New RegularExpressions.Regex("<i>$1</i>")
RichTextBox2.Text = regExp.Replace(RichTextBox1.Text, "\[i\](.+?)\[\/i\]")

Input should be: <i>blahblah</i> and output blahblah, but it gives me same text from richtextbox1 in richtextbox2. Anyone can see whats wrong in this code ?
Cojba Reviewed by Cojba on . Regular Expressions in VB.NET 2005 ? 'Define regex Dim regExp As RegularExpressions.Regex 'Italic text regExp = New RegularExpressions.Regex("<i>$1</i>") RichTextBox2.Text = regExp.Replace(RichTextBox1.Text, "\(.+?)\") Input should be: <i>blahblah</i> and output blahblah, but it gives me same text from richtextbox1 in richtextbox2. Anyone can see whats wrong in this code ? :S Rating: 5