On Wed, 2002-09-04 at 05:17, I wrote:
> 
> attached are two programs:

ugh.


-- 
___________________________________________________________________________
 mailto:[EMAIL PROTECTED]

using System.Reflection;
using System.Text.RegularExpressions;

class RegexSample
{
        static void Main()
        {
                const string pattern = "(?<1>w.*d)";

                AssemblyName assemblyName = new AssemblyName();
                assemblyName.Name = "regex";

                Regex.CompileToAssembly( 
                        new RegexCompilationInfo[] {
                                new RegexCompilationInfo( pattern,
                                                          RegexOptions.None,
                                                          "SampleRegex", 
                                                          "MyRegexNamespace", 
                                                          true )
                        },
                        assemblyName );
        }
}

using System;
using MyRegexNamespace;
using System.Text.RegularExpressions;

class RegexSampleUser
{
        static void Main()
        {
                SampleRegex regex = new SampleRegex();

                Match match = regex.Match( "hello world" );

                if ( match.Success ) {
                        Group group = match.Groups[1];
                        Console.WriteLine( "match found: " + group + " at " + 
group.Index );
                } else
                        Console.WriteLine( "no match found" );
        }
}

Reply via email to