[Mono-list] frozen regex support?
Daniel Stodden
stodden@cs.tum.edu
04 Sep 2002 05:18:38 +0200
--=-v3L00/WOuyyY1VjOTeZP
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Wed, 2002-09-04 at 05:17, I wrote:
>
> attached are two programs:
ugh.
--
___________________________________________________________________________
mailto:stodden@in.tum.de
--=-v3L00/WOuyyY1VjOTeZP
Content-Disposition: attachment; filename=regex2.cs
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=regex2.cs; charset=ISO-8859-1
using System.Reflection;
using System.Text.RegularExpressions;
class RegexSample
{
static void Main()
{
const string pattern =3D "(?<1>w.*d)";
AssemblyName assemblyName =3D new AssemblyName();
assemblyName.Name =3D "regex";
Regex.CompileToAssembly(=20
new RegexCompilationInfo[] {
new RegexCompilationInfo( pattern,
RegexOptions.None,
"SampleRegex",=20
"MyRegexNamespace",=20
true )
},
assemblyName );
}
}
--=-v3L00/WOuyyY1VjOTeZP
Content-Disposition: attachment; filename=regexusage.cs
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=regexusage.cs; charset=ISO-8859-1
using System;
using MyRegexNamespace;
using System.Text.RegularExpressions;
class RegexSampleUser
{
static void Main()
{
SampleRegex regex =3D new SampleRegex();
Match match =3D regex.Match( "hello world" );
if ( match.Success ) {
Group group =3D match.Groups[1];
Console.WriteLine( "match found: " + group + " at " + group.Index );
} else
Console.WriteLine( "no match found" );
}
}
--=-v3L00/WOuyyY1VjOTeZP--