Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regex makes for each loop go bananas ??

Status
Not open for further replies.

N3XuS

Programmer
Mar 1, 2002
339
BE
The code below never triggers the text "out of loop" in txtTest. The program doesn't seem to crash either, it just doesn't execute the code after the for loop. When I comment out the Regex stuff the code behind the for loop is executed. Can anyone help me please, I'm riddled :s

Code:
            For j = 0 To dtParameters.Rows.Count
                Dim RegexObj As Regex = New Regex("(?<=<B>" & dtParameters.Rows(j).Item("Text") & "</B> </TD><TD width=250>).*?(?=<)")
                Dim MatchObj As Match = RegexObj.Match(Me.txtDescription.Text)
            Next
            Me.txtTest.Text = "Out of loop"
 
What happens if you step through the code? How many times does it go through the loop? Does it exit out of the loop? Is the next line hit?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
A coworker helped me out, was uhm pretty dumb of me. I'm used to working with ASP.net, which likes producing errors. Apparently VB.net just malfunctions. I got out of index boundary, pretty dumb :s

Thanks for helping ca :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top