Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Text.RegularExpressions
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- IP2TextBox.Text = ""
- Dim x As Integer 'declared for scanning all of the lines in IPTextBox
- Dim abc As String 'declared for holding the content enterered into IPTextBox
- For x = 0 To IPTextBox.Lines.Count - 1 ' this scans all the lines of the IPTextBox
- abc = IPTextBox.Lines(x) 'this gets the content of the line
- Dim Pattern = "(.*):...." 'this is my pattern for seaching for a specific string in the text
- Dim Result = Regex.Match(abc, Pattern)
- 'this will apply the Pattern to everything in the IPTextBox and store it in result
- ' using the Regular Expressions class library dedicated to string searching.
- IP2TextBox.Text = IP2TextBox.Text & Result.Groups(1).Value & vbCrLf 'this adds the name of the game to the 2'nd text box
- 'This is for a listbox, if thats what you prefer.
- 'TempListBox.Items.Add(Result.Groups(1).Value) 'this add the name of the game to the listbox
- Next
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement