pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

VB.NET pastebin - collaborative debugging tool View Help


Posted by Anonymous on Sat 11 Oct 11:11
report abuse | download | new post

  1. Imports System.Text.RegularExpressions
  2. Module Module1
  3.     Sub Main()
  4.         Dim sr1 As New IO.StreamReader("input.txt")
  5.         Dim strFile As String = sr1.ReadToEnd
  6.         sr1.Close()
  7.         Dim re1 As Regex = New Regex("\r\n-{30,}.*$", RegexOptions.Singleline)
  8.         If re1.IsMatch(strFile) Then
  9.             strFile = re1.Replace(strFile, "") 'remove the additional LT= sections if you want to ignore them
  10.         End If
  11.         Dim re2 As Regex = New Regex("(?<!/)(?<varname>[A-Z]+)/ *(?<varvalue>[\w ,-]+)(?= +[A-Z]+/|\r\n)|(?<varname>[A-Z#]+)= *(?<varvalue>[\w /-]+)(?= +[A-Z]+=|\r\n)")
  12.         Dim mc As MatchCollection = re2.Matches(strFile)
  13.         Dim mIdx As Integer = 0
  14.         For Each m As Match In mc
  15.             Console.WriteLine(">>>varname '" & m.Groups("varname").Value.Trim & "' contains '" & m.Groups("varvalue").Value.Trim & "'<<<")
  16.         Next
  17.         Console.WriteLine("Done.")
  18.     End Sub
  19. End Module

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post