Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8727869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:31:13+00:00 2026-06-13T08:31:13+00:00

I have a problem reading every line to count the regex of <a href=

  • 0

I have a problem reading every line to count the regex of <a href=
when the regex been match it will skip the line and not finish till the end. For example, here I have two <a href tags, but after reading the first one it will jump to the next line:

"<p class="txt">Everyone seemed cool with that, including Coach A, so we went to work putting it all together. The end result had us starting off standing in a <strong>V formation</strong><a href="../Text/chap5.html#b1" id="f1">*</a>, and then the girls in back would tumble forward so that we were all in a straight line for the cheer. It was a really cool idea! To finish things off, we’d transition into two stunt groups that would do side-by-side <strong>elevators</strong><a href="../Text/chap5.html#b2" id="f2"></a>.</p>"

Here is my code:

        Dim count1 As Integer = 0
        For p As Integer = 0 To lvw.Items.Count - 1
        Dim r As StreamReader = New StreamReader(New FileStream(Path.Combine(lvw.Items(p).Tag, lvw.Items(p).Text), FileMode.Open, FileAccess.Read, FileShare.Read))

        Do While Not r.EndOfStream
            Dim strr1 As String = r.ReadLine.Trim
            Try
                Dim regex As Regex = New Regex("<a\s+[^>]*(href\s*=\s*(['""]).*?\2)")
                Dim m As Match = regex.Match(strr1)

                If m.Success Then
                    count1 += 1

                End If
                Label2.Text = (count1.ToString)
            Catch ex As Exception
            End Try
        Loop

    Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:31:16+00:00Added an answer on June 13, 2026 at 8:31 am

    Are you required to use ReadLine? You could use ReadToEnd to get the whole text at once, then use

    regex.Matches(strr1).Count
    

    to get the count of matches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have been reading about multiple inheritance What is the exact problem with multiple
I have a problem reading a string in specific line and specific position. I
I have a problem reading a txt file to insert in the mysql db
Android 2.1 update 1 Eclipse 3.5 I have a problem reading data from my
I have a problem with reading some gml files in c#. My files do
I have some problem with reading from sqlite3 database. -(void) readMessengesFromDatabase { sqlite3 *database;
In my assignment i have a problem with reading a file. See the following
i have one problem controlling checkbox, i'm reading, and searching about the topic but
My problem involves checking if I have a valid database connection before reading from
I have a code for reading files with float numbers on line stored like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.