The following regular expression works if there is no space character, but if the input has a space character, it doesn't work (it seems like a link but JavaScript doesn't work).
How can I change it?
The regular expression should work for both World
and The World
.
Dim makebkz As String
Dim pattern As String = "\(bkz: ([a-z0-9$&.öışçğü\s]+)\)"
Dim regex As New Regex(pattern, RegexOptions.IgnoreCase)
Dim myAnchor As New System.Web.UI.HtmlControls.HtmlAnchor()
Dim postbackRef As String = Page.GetPostBackEventReference(myAnchor, "$1")
myAnchor.HRef = postbackRef
str = regex.Replace(str, "(bkz: <a href=javascript:" & myAnchor.HRef & "><font color=""#CC0000"">$1</font></a> )")
makebkz = str
Return makebkz