Click here to Skip to main content
6,293,171 members and growing! (12,065 online)
Email Password   helpLost your password?
Languages » VB.NET » General     Intermediate

Regex Tester

By Harish Palaniappan

A simple Regex Tester. The code also illustrates the simple usage of regular expressions in .NET
VB, Windows, .NET 1.0, Dev
Posted:1 Jun 2003
Views:68,953
Bookmarked:18 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
20 votes for this article.
Popularity: 3.46 Rating: 2.66 out of 5
6 votes, 30.0%
1
3 votes, 15.0%
2
3 votes, 15.0%
3
4 votes, 20.0%
4
4 votes, 20.0%
5

Sample Image - regexTester.gif

Introduction

The Regex Tester is an application to use for testing regular expression patterns on a test string, as we create the pattern, rather than testing it on the actual input, which may be sometimes time consuming, especially for large input strings.

Using the RegexTester

The usage is more straight forward. The input string is typed in the test string box, and the pattern is typed in the pattern textbox, as shown above.

Regular Expressions in .NET

Using regular expressions in .NET is pretty simple.. using the regularexpressions namespace available

Imports System.Text.RegularExpressions
' import the namespace


'instantiate the objects

dim oRegex as new regex("test pattern")

'use the object

If oRegex.IsMatch("this is the string to test on") Then
    msgbox "Match found"
else
    msgbox "Didnt find match"
end if

Points of Interest

The RegexTester with this article has a little nice feature for you to experiment. If the test string box is left empty, the application searches for a file teststring.txt (can be anything if the code attatched is aptly modified), and if the file is found, uses the contents of the file as a test string. This feature comes in needy, when the input string / test string is large.

If you already are conversant with simple .NET programming and the process of creating regular expression patterns, the Regex Tester might be all u need. ;)

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Harish Palaniappan


Member
Harish is a software consultant. Loves computers for their basic quality of running tasks given and doing things clockwork without day-dreaming like him.
Occupation: Architect
Location: India India

Other popular VB.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
NewsThere's a new version of the RegEx Tester Tool ! PinmemberBucanerO_Slacker0:25 2 Mar '08  
GeneralRegular Expressions with a range of numbers Pinmemberkongo1020:36 18 Nov '05  
GeneralRe: Regular Expressions with a range of numbers PinmemberHarish Palaniappan8:24 19 Nov '05  
GeneralHandy PinmemberVoldo20:55 20 Apr '04  
GeneralExpresso PinmemberJonathan de Halleux21:30 2 Jun '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 1 Jun 2003
Editor: Nishant Sivakumar
Copyright 2003 by Harish Palaniappan
Everything else Copyright © CodeProject, 1999-2009
Web18 | Advertise on the Code Project