What I am trying to do is figure out the regex code needed to find the text between
and tags so that I can extract it and write over it. So what I think would happen is that I would find the tag, (which could also be aparently, and then extract that text (just in case I need it later), and then be able to put text after this tag from a variable and have it be input before the
tag, (which could also be h1 >, or h 1 > even). Any idea of the regex code as well as the class needed to do this in VB.NET? Here is what I have:
Dim allText As String = FileReader.ReadToEnd
Dim holdText As Match
Dim theregexpattern As String = "*"
Dim aregex As New Regex(theregexpattern)
holdText = aregex.Match(allText)
I unfortunatly can not get anything bigger than the tag, (I want to get the text between the two tags and replace it. Notice I have a * in the regex but it is not picking up any of the characters between the two tags.
Thanks,
2007-08-10
18:53:11
·
1 answers
·
asked by
Brian D
1
in
Computers & Internet
➔ Programming & Design
I have been trying to figure out how to get the text between the tags and so I tried * but that doesn't even work for the text after the first tag. I realize I don't have the second tag's regex in the code, I have been trying to do it step by step but I can't even get a
Hello World found. I keep getting an "" string when I try and add the *. Furthermore once I can do this, (perhaps I am even going in the wrong direction as I just want to replace what is in between the tags with stuff that I have from a string variable). I have been doing much research on Regex but am still not sure how to do this, that is to just replace the text in between the two tags. Any ideas? Especially examples in this case as I just seem to be doing something wrong. Any help is much appreciated.
Thanks,
Brian
2007-08-10
18:59:12 ·
update #1