[Mono-dev] Mono Regex not working the same as MS .NET
St4rNin3
st4rnin3 at gmail.com
Sun Jul 26 18:13:01 EDT 2009
oh man, am i ever embarrassed... you are right on. :blush:
with that change, the code works as expected.
Thank you!
--Dan Gentry
Adar Wesley-2 wrote:
>
> Hi,
>
> I would suspect the \r\n part of the pattern. On UNIX systems new line
> does
> not include the \r.
>
> ---
> Adar Wesley
>
>
> On Sun, Jul 26, 2009 at 7:57 PM, Alan McGovern
> <alan.mcgovern at gmail.com>wrote:
>
>> Hey,
>>
>> Could you take that testcase and info a file a bug report on
>> bugzilla.novell.com
>> . This way the isse won't be forgotten about and will be dealt with
>> properly.
>>
>> Alan.
>>
>> On 26 Jul 2009, at 17:50, St4rNin3 <st4rnin3 at gmail.com> wrote:
>>
>> >
>> > I am having some issues with Regex processing. It seems that the
>> > Mono engine
>> > and the .NET engine get different results.
>> >
>> > The code below works just fine on my Windows PC, but gets no matches
>> > on my
>> > Linux System.
>> >
>> > I am using Mandriva 2009 Spring, with the 2.2 version of Mono. I
>> > have not
>> > downloaded the latest 2.4 release. I was trying not to have to
>> > manually
>> > install on Mandriva (2.2 is the latest in their package system)
>> >
>> >
>> > I have taken a snippet of code (with some hard coded data) for
>> > demonstration
>> > purposes.
>> > =========================================
>> > string sData =
>> > @"-
>> > --------------------------------------------------------------------
>> > 001-00000151 :LastNameHolder;FirstnameHolder :Address Holder";
>> >
>> > string sPattern;
>> > sPattern = @"---+\r\n(?<AccountNumber>\d{3}-\d{8}).*?";
>> >
>> >
>> >
>> > MatchCollection mc;
>> > mc = Regex.Matches(sData, sPattern,
>> > RegexOptions.IgnoreCase |
>> > RegexOptions.Singleline);
>> > label1.Text = string.Format("{0} matches found", mc.Count);
>> >
>> > ========================================
>> > Any Ideas?
>> >
>> > Dan Gentry
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Mono-Regex-not-working-the-same-as-MS-.NET-tp24629584p24629584.html
>> > Sent from the Mono - Dev mailing list archive at Nabble.com.
>> >
>> > _______________________________________________
>> > Mono-devel-list mailing list
>> > Mono-devel-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
--
View this message in context: http://www.nabble.com/Mono-Regex-not-working-the-same-as-MS-.NET-tp24629584p24671037.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
More information about the Mono-devel-list
mailing list