Hi,
I want to write a Code-to-HTML libaray and add <font color="orange"> tags to string between "" (" in html).
For example, the line :
will be replaced as :
It means the line :
would be:
Iv tried to write an RE but failed.
Any correction appreciated!
Regards,
Stanley
I want to write a Code-to-HTML libaray and add <font color="orange"> tags to string between "" (" in html).
For example, the line :
"<%@ TagName="SourceCtrl" ABC=""6876786""%>"
will be replaced as :
"<%@ TagName=<font color="orange">"SourceCtrl"</font> ABC=<font color="orange">""6876786""</font>%>"
It means the line :
<%@ TageName="SourceCtrl" ABC=""6876786"">
would be:
<%@ TageName="SourceCtrl" ABC=""6876786"">
Iv tried to write an RE but failed.
Const TAG_FNTORG As String = "<font color=" + Chr(34) + "orange" + Chr(34) + ">"
Dim sourceLine As String = "<%@ TagName="SourceCtrl" ABC=""6876786""%>"
Dim sourceLine2 As String = ""
searchExpr = "(?i)" + "(?<a>("(.*?))" + "(?<b>(.+?))" + "(?<c>(")"
replaceExpr = TAG_FNTORG + "${a}" + "${b}" + "${c}" + TAG_EFONT
If (Regex.IsMatch(sourceLine, searchExpr)) Then
sourceLine2 = Regex.Replace(sourceLine, searchExpr, replaceExpr)
End If
Any correction appreciated!
Regards,
Stanley
Last edited by a moderator: