M
Mad Scientist Jr
hi
i am trying to do a replace in HTML of all instances of
<LI><FONT FACE="Times New Roman" SIZE="3"
COLOR="#000000"></FONT></LI>
for all font faces, all sizes, and all colors
with
<P> </P>
for instance, my document of
abc
<LI><FONT FACE="Times New Roman" SIZE="3"
COLOR="#000000"></FONT></LI>
123
would look like
abc
<P> </P>
123
when replaced
i think regular expressions is the way to go,
but i am getting caught up in the syntax
some formulas have tried to use:
<LI><FONT FACE="*" SIZE="*" COLOR="*"></FONT></LI>
\<LI\>\<FONT FACE="*" SIZE="*" COLOR="*"\>\</FONT\>\</LI\>
\<LI\>\<FONT*FACE="*"*SIZE="*"*COLOR="*"\>\<\/FONT\>\<\/LI\>
any help appreciated!
reg expressions seem a really important thing to know
and if i can just get the basics down then i think i'll be ok
thanks in advance
PS my code seems to work, the form starts with
Imports System.Text.RegularExpressions
and Button1 takes the values of 3 textboxes (for the source text,
expression, and replacement text) and puts the replace results in the
output box:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim sReplaceTemplate As String
Dim RegEx1 As Regex
RegEx1 = New Regex(txtEx.Text)
txtOut.Text = (RegEx1.Replace(txtSource.Text,
txtReplaceWith.Text))
End Sub
i am trying to do a replace in HTML of all instances of
<LI><FONT FACE="Times New Roman" SIZE="3"
COLOR="#000000"></FONT></LI>
for all font faces, all sizes, and all colors
with
<P> </P>
for instance, my document of
abc
<LI><FONT FACE="Times New Roman" SIZE="3"
COLOR="#000000"></FONT></LI>
123
would look like
abc
<P> </P>
123
when replaced
i think regular expressions is the way to go,
but i am getting caught up in the syntax
some formulas have tried to use:
<LI><FONT FACE="*" SIZE="*" COLOR="*"></FONT></LI>
\<LI\>\<FONT FACE="*" SIZE="*" COLOR="*"\>\</FONT\>\</LI\>
\<LI\>\<FONT*FACE="*"*SIZE="*"*COLOR="*"\>\<\/FONT\>\<\/LI\>
any help appreciated!
reg expressions seem a really important thing to know
and if i can just get the basics down then i think i'll be ok
thanks in advance
PS my code seems to work, the form starts with
Imports System.Text.RegularExpressions
and Button1 takes the values of 3 textboxes (for the source text,
expression, and replacement text) and puts the replace results in the
output box:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim sReplaceTemplate As String
Dim RegEx1 As Regex
RegEx1 = New Regex(txtEx.Text)
txtOut.Text = (RegEx1.Replace(txtSource.Text,
txtReplaceWith.Text))
End Sub