Results 1 to 7 of 7

Thread: RX Show more than one result?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    RX Show more than one result?

    Using Code:
    1. Dim RXLIKEIT As New System.Text.RegularExpressions.Regex("(?<="">).+?(?=</a></td>\s<td>)")

    MsgBox("Did you mean't:" & (RXLIKEIT.Match(DL).Value))

    How do i put it show more results than only one "RXLIKEIT"?

    Some help please?

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: RX Show more than one result?

    The regular expression class has a matches property which will return a collection of matches:
    Code:
            Dim sb As New StringBuilder
            sb.AppendLine("Possible matches are:")
            For Each m As Match In RXLIKEIT.Matches(DL)
                sb.AppendLine(m.Value)
            Next
    
            MessageBox.Show(sb.ToString())

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    Re: RX Show more than one result?

    Unknown word "StringBuilder"

  4. #4
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: RX Show more than one result?

    It is in the System.Text namespace.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    Re: RX Show more than one result?

    For Each m As Match In RXLIKEIT.Matches(DL)
    sb.AppendLine(m.Value)
    Next


    Can i ask. What this "m" is in this?

  6. #6
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: RX Show more than one result?

    m is a match. The For Each loop is looping through the list of matches and assigning the variable m with the current match from the loop.

    Read up on the For Each statement:http://msdn.microsoft.com/en-us/library/5ebk1751.aspx

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2008
    Location
    >> ( ҉ )
    Posts
    413

    Re: RX Show more than one result?

    Thanks

    I don't still understand this
    I readed about it but so wierd still.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width