[Mono-bugs] [Bug 677823] New: Cannot create culture-insensitive regular expressions

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 8 11:40:00 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=677823

https://bugzilla.novell.com/show_bug.cgi?id=677823#c0


           Summary: Cannot create culture-insensitive regular expressions
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: iPhone
        OS/Version: Apple iOS 4.2
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: michael at dauntless-soft.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer
           Blocker: Yes


Description of Problem:

I have a problem with regular expressions in my MonoTouch application. It
appears that RegexOptions.CultureInvariant is ignored, and expressions are
always evaluated using the device default culture.

Steps to reproduce the problem:

1. Set the region format to 'Turkey(Turkish)' (in Settings - General -
International).
2. Run the code below:
//-----
Regex rx_I = new Regex(@"II", RegexOptions.IgnoreCase |
RegexOptions.CultureInvariant);
Regex rx_i = new Regex(@"ii", RegexOptions.IgnoreCase |
RegexOptions.CultureInvariant);

string aString = "Ii";

Match match;

match=rx_I.Match(aString);
if(match.Success){
    Console.WriteLine(match.Value);
}

match=rx_i.Match(aString);
if(match.Success){
    Console.WriteLine(match.Value);
}
//-----


Actual Results:
Both matches are not successful if the region format is set to Turkey.


Expected Results:
Both matches should be successful regardless of the device region format.


How often does this happen? 
Always

Additional Information:
The problem is reproducible both in simulator and on real devices (tested with
iPad/iPhone 4/iPod Touch running iOS 4.2.1; MonoTouch version is 3.2.4).

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list