how to filter textbox text?
i use this code to copy webbrowser text in textbox3

TextBox3.Text = WebBrowser1.Document.Body.InnerText

it show all text in textbox like this

Advanced search  Board index ‹ Socks Change font size E-mail friendPrint view User Control Panel (0 new messages) • View your posts Arcade Chat FAQ Members Logout [ crypo ] 
[ Moderator Control Panel ]
Sockz 6:04am update
Post a reply     1 post • Page 1 of 1 
Edit postDelete postReport this postInformationReply with quote Sockz 6:04am update
by crypo » 16 Apr 2012, 20:36

i want to filter this text

just want to show these items in text box

how to do that any help?
5 Years
Discussion Span
Last Post by thines01

You could do something like this (that works on this very posting):

Imports System.Net
Imports System.IO
Imports System.Text.RegularExpressions

Module Module1

   Sub Main()
      Dim rxIpAndPort As New Regex("(?<ip_and_port>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5})")
      Dim wc As New WebClient
      Dim fileInFile As New StreamReader(wc.OpenRead("http://www.daniweb.com/software-development/vbnet/threads/422678/filter-textbox-text"))
      Dim arr_strData = fileInFile.ReadToEnd() _
         .Split((Chr(10) + Chr(13) + "<> ") _
         .ToCharArray(), StringSplitOptions.RemoveEmptyEntries) _
         .Where(Function(s) rxIpAndPort.IsMatch(s)) _
         .Select(Function(s) rxIpAndPort.Match(s).Groups("ip_and_port").Value) _
         .Distinct() _

      ' TextBox3.Text = String.Join(Environment.NewLine, arr_strData)
      System.Diagnostics.Debug.WriteLine(String.Join(Environment.NewLine, arr_strData))
   End Sub

End Module

Edited by thines01: Attached output picture

Attachments DW_422678.jpg 24.04 KB

no link involved

i load text in to text box then press 1 button to filter not grabbing from some link


That was just an example. You can parse your text the same way from the text box.
Like TextBox3.Text = TextBox3.Text.Split((Chr(10) ... 'and so on...'


still not understandin

i load text in textbox from 1 text file

then i filter it

in example u showed u grabbing from link

am trying to learn and help my self so new things not understandable for me


Then the first example will work.
Instead of opening a StreamReader to a web page, open that same StreamReader to your text file.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.