[Mono-list] RE: Problem with Regex
Chris J. Breisch
cjbreisch@altavista.net
Sat, 18 May 2002 00:20:18 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C1FE01.CAD67800
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hmmmm.actually, I can't seem to get ANY Regex to work using our
System.dll
Test file (and I know that it doesn't actually DO anything):
using System;
using System.Text.RegularExpressions;
class test {
static int Main(string [] args) {
double d = Val("1.0");
return 0;
}
public static double Val (string InputStr) {
Regex NumberReg;
NumberReg = new Regex (".*");
return 0;
}
}
Compiled as:
csc /noconfig /lib:e:/cygwin/usr/local/lib
/r:e:/cygwin/usr/local/lib/System.dll test.cs
Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.
Ildasm verifies that it's using the mono version of System.dll
When I run my executable, I get a System.IO.FileNotFoundException:
Unhandled Exception: System.IO.FileNotFoundException: File or assembly
name System, or one of its dependencies, was not found.
File name: "System"
at test.Val(String InputStr)
at test.Main(String[] args)
Fusion log follows:
=== Pre-bind state information ===
LOG: DisplayName = System, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
(Fully-specified)
LOG: Appbase = E:\cygwin\home\cjbreisch\
LOG: Initial PrivatePath = NULL
Calling assembly : test, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===
LOG: Policy not being applied to reference at this time (private,
custom, partial, or location-based assembly bind).
LOG: Post-policy reference: System, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null
LOG: Attempting download of new URL
file:///E:/cygwin/home/cjbreisch/System.DLL.
LOG: Attempting download of new URL
file:///E:/cygwin/home/cjbreisch/System/System.DLL.
LOG: Attempting download of new URL
file:///E:/cygwin/home/cjbreisch/System.EXE.
LOG: Attempting download of new URL
file:///E:/cygwin/home/cjbreisch/System/System.EXE
<file:///E:\cygwin\home\cjbreisch\System\System.EXE> .
-chris
Chris J. Breisch, MCSD, MCDBA
-----Original Message-----
From: Chris J. Breisch [mailto:cjbreisch@altavista.net]
Sent: Friday, May 17, 2002 11:58 PM
To: 'mono-list@ximian.com'
Subject: Problem with Regex
Putting aside for the moment whether or not you'd ever really want to do
such a thing.
Is there something wrong with this? Our Regex seems to hate it.
Regex NumberReg;
NumberReg = new Regex ("^[+-]?\\d*\\.?\\d*(e?[+-]?\\d*)");
-chris
Chris J. Breisch, MCSD, MCDBA
------=_NextPart_000_000E_01C1FE01.CAD67800
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:9.0pt;
font-family:Verdana;}
h1
{margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
text-align:center;
page-break-after:avoid;
font-size:16.0pt;
font-family:Arial;}
h2
{margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
page-break-after:avoid;
font-size:14.0pt;
font-family:Arial;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.Code, li.Code, div.Code
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.E-mail, li.E-mail, div.E-mail
{margin:0in;
margin-bottom:.0001pt;
text-autospace:none;
font-size:9.0pt;
font-family:Verdana;
color:maroon;}
span.NormalFont
{font-family:Verdana;}
p.code0, li.code0, div.code0
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.e-mail0, li.e-mail0, div.e-mail0
{margin:0in;
margin-bottom:.0001pt;
text-autospace:none;
font-size:9.0pt;
font-family:Verdana;
color:maroon;}
span.normalfont0
{font-family:Verdana;}
span.emailstyle20
{font-family:Verdana;
color:maroon;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle24
{font-family:Verdana;
color:maroon;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Hmmmm…actually, I =
can’t seem
to get ANY Regex to work using our System.dll</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Test file (and I know that it =
doesn’t
actually DO anything):</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>using System;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>using =
System.Text.RegularExpressions;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>class test {</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p; static
int </span></font><font color=3Dmaroon><span =
style=3D'color:maroon'>Main</span></font><font
color=3Dmaroon><span style=3D'color:maroon'>(string [] args) =
{</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; double
d =3D Val("1.0");</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; return
0;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p; }</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p; public
static double Val (string InputStr) {</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; Regex
NumberReg;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; NumberReg
=3D new Regex (".*");</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; return
0;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p; }</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>}</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Compiled as:</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>csc /noconfig =
/lib:e:/cygwin/usr/local/lib
/r:e:/cygwin/usr/local/lib/System.dll test.cs</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Microsoft (R) Visual C# .NET =
Compiler
version 7.00.9466</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>for Microsoft (R) .NET Framework =
version
1.0.3705</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Copyright (C) Microsoft =
Corporation 2001.
All rights reserved.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Ildasm verifies that it’s =
using the
mono version of System.dll</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>When I run my executable, I get a
System.IO.FileNotFoundException:</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Unhandled Exception:
System.IO.FileNotFoundException: File or assembly name System, or one of =
its
dependencies, was not found.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>File name: =
"System"</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> at test.Val(String =
InputStr)</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> at =
test.Main(String[] args)</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Fusion log follows: =
</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>=3D=3D=3D Pre-bind state =
information =3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: DisplayName =3D System,
Version=3D0.0.0.0, Culture=3Dneutral, =
PublicKeyToken=3Dnull</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> (Fully-specified)</span></fo=
nt></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Appbase =3D =
E:\cygwin\home\cjbreisch\</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Initial PrivatePath =3D =
NULL</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Calling assembly : test, =
Version=3D0.0.0.0,
Culture=3Dneutral, PublicKeyToken=3Dnull.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>=3D=3D=3D</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Policy not being applied to =
reference
at this time (private, custom, partial, or location-based assembly =
bind).</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Post-policy reference: =
System,
Version=3D0.0.0.0, Culture=3Dneutral, =
PublicKeyToken=3Dnull</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Attempting download of new =
URL
file:///E:/cygwin/home/cjbreisch/System.DLL.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Attempting download of new =
URL
file:///E:/cygwin/home/cjbreisch/System/System.DLL.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Attempting download of new =
URL
file:///E:/cygwin/home/cjbreisch/System.EXE.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>LOG: Attempting download of new =
URL <a
href=3D"file:///E:\cygwin\home\cjbreisch\System\System.EXE">file:///E:/cy=
gwin/home/cjbreisch/System/System.EXE</a>.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; =
&=
nbsp; -chris</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<div>
<p class=3DMsoNormal><b><font
color=3Dmaroon><span style=3D'color:maroon;font-weight:bold'>Chris J. =
Breisch, <i><span
style=3D'font-style:italic'>MCSD, MCDBA</span></i></span></font></b></p>
<p class=3DMsoNormal><font color=3Dmaroon><span =
style=3D'color:maroon'> </span></font></p>
</div>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>-----Original Message-----<br>
<b><span style=3D'font-weight:bold'>From:</span></b> Chris J. Breisch
[mailto:cjbreisch@altavista.net] <br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> </span></font><font =
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'>Friday, May 17,
2002</span></font><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'> </span></font><font size=3D2 face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>11:58 =
PM</span></font><font
size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;font-family:Tahoma'><br>
<b><span style=3D'font-weight:bold'>To:</span></b> =
'mono-list@ximian.com'<br>
<b><span style=3D'font-weight:bold'>Subject:</span></b> Problem with =
Regex</span></font></p>
<p class=3DMsoNormal><font size=3D1 face=3DVerdana><span =
style=3D'font-size:9.0pt'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Putting aside for the moment =
whether or
not you’d ever really want to do such a =
thing…</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Is there something wrong with =
this?
Our Regex seems to hate it.</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>Regex =
NumberReg;</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'>NumberReg =3D new Regex
("^[+-]?\\d*\\.?\\d*(e?[+-]?\\d*)");</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> &nbs=
p;  =
; =
-chris</span></font></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><b><font size=3D1 color=3Dmaroon =
face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon;font-weight:bold'>Chris J. =
Breisch, <i><span
style=3D'font-style:italic'>MCSD, MCDBA</span></i></span></font></b></p>
<p class=3DMsoNormal><font size=3D1 color=3Dmaroon face=3DVerdana><span
style=3D'font-size:9.0pt;color:maroon'> </span></font></p>
<p class=3DMsoNormal><font size=3D1 face=3DVerdana><span =
style=3D'font-size:9.0pt'> </span></font></p>
</div>
</body>
</html>
------=_NextPart_000_000E_01C1FE01.CAD67800--