Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1.  
  2. Imports System.Text.RegularExpressions
  3. Public Class Form1
  4.  
  5. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  6. IP2TextBox.Text = ""
  7.  
  8. Dim x As Integer 'declared for scanning all of the lines in IPTextBox
  9. Dim abc As String 'declared for holding the content enterered into IPTextBox
  10.  
  11. For x = 0 To IPTextBox.Lines.Count - 1 ' this scans all the lines of the IPTextBox
  12. abc = IPTextBox.Lines(x) 'this gets the content of the line
  13. Dim Pattern = "(.*):...." 'this is my pattern for seaching for a specific string in the text
  14.  
  15. Dim Result = Regex.Match(abc, Pattern)
  16.  
  17. 'this will apply the Pattern to everything in the IPTextBox and store it in result
  18. ' using the Regular Expressions class library dedicated to string searching.
  19.  
  20. IP2TextBox.Text = IP2TextBox.Text & Result.Groups(1).Value & vbCrLf 'this adds the name of the game to the 2'nd text box
  21.  
  22. 'This is for a listbox, if thats what you prefer.
  23. 'TempListBox.Items.Add(Result.Groups(1).Value) 'this add the name of the game to the listbox
  24.  
  25. Next
  26. End Sub
  27.  
  28.  
  29. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement