*
om****@wp.pl wrote, On 19-5-2007 13:39:
Hi!
I have a simple regural expression:
\w+$
and text to match:
abc dddd
ggg
hhh
It should match three times:
dddd
ggg
hhh
but it only match once (for hhh).
Why? I USE multiline option so $ should match end of each line.
(I checked it in Python and Java and in these languages it worked
correctly).
Are there any other odd things in .NET Regex?
Regards
This seems to be a bug in the framework. Which version of Windows are
you testing on? I just tested on Vista and I get the error. But I used
this construction in my courses before, so I know they worked at some point.
The funny thing is that if you use .+$, then it works, but the caputerd
text is one character too long. I haven 't yet looked in the debugger
which one that is, but I'm guessing either \r or \n.
Ok. couldn't resist, and just tested; the following expression works:
([\w\r]+?)$
So \r\n aren't seen as line end together, where they should be depending
on your systems settings.
It looks like the Regex engine bug day today. Early this morning a regex
that bluescreened my vista installation, and now this.
My guess is that it is a bug in either the 2.0 or the 2.5 framework. I
tested it in The Regulator (running under famework 1.1 under XP) and it
works like a charm. Testing under the Rad.RegexDesigner fails and that
is either running under 2.0 or 2.5 under both XP and Vista.
Jesse