i need a Regular Expression to convert a a string to a link.i wrote something but it doesnt work in asp.net.i couldnt solve and i am new in Regular Expression.This function converts (bkz: string) to (bkz: show.aspx?td=string)
Dim pattern As String = '<bkz[a-z0-9$-$&-&.-.ö-öı-ış-şç-çğ-ğü-ü\s]+)>' Dim regex As New Regex(pattern, RegexOptions.IgnoreCase) str = regex.Replace(str, '<a href=''show.aspx?td=$1''><font color=''#CC0000''>$1</font></a>')
Your regexp is in trouble because of a ‘)’ without ‘(‘
Would:
work better ?
The first group would capture what you are after.