Re: Regex help
- From: "Michael Persaud" <jinxpersaud@xxxxxxxxxxx>
- Date: Fri, 10 Jun 2005 15:50:15 -0400
I had a similar experience and the following modified block helped
Dim regexp As Regex = New Regex("<div id=((.|\n)*?)config</div>",
RegexOptions.IgnoreCase)
Dim str As String
Dim objMatch As Match
For Each objMatch In regexp.Matches(text)
str = objMatch.ToString()
Next
Hope this helps
Michael
"Marius Trælnes" <marius.traelnesnospam@xxxxxxxxxxxxx> wrote in message
news:eCLstPcbFHA.1040@xxxxxxxxxxxxxxxxxxxxxxx
> Hello!
>
> I have a file with following htmlt tags:
>
> ....can be anything before....
> <div id="SomeConfig">
> some text, can be anything here, also any tag
> </div>
> ....can be anything after......
>
> I want to "cut" out the div which has an id attribute with config in its's
> value. In the above sample
> this would be:
> <div id="SomeConfig">
> some text, can be anything here, also any tag
> </div>
>
> I try with this but it does not work:
>
> Dim re As Regex = New Regex("(<div id=.*?config.*?div>)",
> RegexOptions.IgnoreCase)
> Dim m As Match = re.Match(Text)
> Dim s As String = m.Value()
>
> Any suggestions?
>
> Marius
>
>
.
- References:
- Regex help
- From: Marius Trælnes
- Regex help
- Prev by Date: Re: Minimize other apps to the systray
- Next by Date: Re: Polling a folder
- Previous by thread: Re: Regex help
- Next by thread: Formatting textboxes in VB.NET
- Index(es):
Relevant Pages
|