Click here to Skip to main content
15,895,799 members
Articles / Programming Languages / C#

RegEx Tester - Regular Expression Tester

Rate me:
Please Sign up or sign in to vote.
4.98/5 (62 votes)
22 May 2011GPL36 min read 172.4K   9.2K   189  
It aids you to develop and fully test your regular expression against a target text.
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, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior) BucanerO's inc.
Argentina Argentina
I'm from Argentina, 28 y/o (by 2011) and work as a software developer since I was 16 after messing around with computers since I was 8.

Comments and Discussions