[Mono-dev] Re gex Problems

Zoltan Varga vargaz at gmail.com
Sun Aug 23 15:55:03 EDT 2009


Hi,

   Linux uses '\n' as the line ending, not '\r\n'. Maybe this is the source
of the problem.

              Zoltan

On Thu, Jul 23, 2009 at 6:32 PM, 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/Regex-Problems-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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090823/afe8c5ca/attachment.html 


More information about the Mono-devel-list mailing list