Click here to Skip to main content
15,886,857 members
Articles / Programming Languages / C#

RegExTest: Regular Expression Tester

Rate me:
Please Sign up or sign in to vote.
3.52/5 (19 votes)
6 Aug 2003 82.2K   1.1K   23  
With RegExTest, you can fully test your regular expressions against a target text. Regular Expression syntax is not so obvious, so a quick test enviroment is really helpful in all situations. RegExTest allows you to use and test grouping functions.
using System;
using System.Runtime.InteropServices;

namespace RegExTester
{
	/// <summary>
	/// Class by Corrado Cavalli, found on UGIDOTNET.ORG
	/// </summary>
	public class CLRInfos
	{
		//API declares
		[DllImport("mscoree.dll")] static extern Int32 GetCORSystemDirectory ([MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder buffer,Int32 buflen, ref Int32 numbytes);
		[DllImport("mscoree.dll")] static extern Int32 GetCORVersion ([MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder buffer,Int32 buflen, ref Int32 numbytes); 
		static public String SystemDirectory()
		{
			System.Text.StringBuilder buf=new System.Text.StringBuilder(1024);
			Int32 iBytes=0;
			Int32 ret= GetCORSystemDirectory(buf,buf.Capacity, ref iBytes);
			return buf.ToString().Substring(0,iBytes-1);
		}
		public static string Version()
		{
			System.Text.StringBuilder buf = new System.Text.StringBuilder(1024);
			Int32 iBytes=0;
			Int32 ret= GetCORVersion(buf,buf.Capacity, ref iBytes);
			return buf.ToString().Substring(0,iBytes-1); 
		}
	} 
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

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


Written By
Web Developer
Italy Italy
Born in 1977, works as a freelancer, focusing on Database / Software Architecture.
In the free time writes articles for two of the major Italian programming magazines (Computer Programming and VBJ) and also develops nice and useful programs.
His major interests and skills are the .NET framework (C# in particular) and SQL Server.

Comments and Discussions