• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RegexkitLite - Possible bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RegexkitLite - Possible bug?


  • Subject: RegexkitLite - Possible bug?
  • From: K.Darcy Otto <email@hidden>
  • Date: Sun, 17 Jan 2010 13:15:20 -0800

I've been working with RegexkitLite, and I'm wondering whether someone else who has RegexkitLite can reproduce this problem, or spot what I'm doing wrong:

NSString *originalString = @"IMUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIU";

// Using the built-in "range:" option
NSString *firstTry = [originalString stringByReplacingOccurrencesOfRegex:@"M(.*)" withString:@"M$1$1" range:NSMakeRange(1,57)];
NSLog(@"firstTry result: %@",firstTry);

// Using "substringWithRange:" first
NSString *cutOriginalString = [originalString substringWithRange:NSMakeRange(1, 57)];
NSString *secondTry = [cutOriginalString stringByReplacingOccurrencesOfRegex:@"M(.*)" withString:@"M$1$1"];
NSLog(@"secondTry result: %@",secondTry);


Output:

firstTry result: (null)
secondTry result: MUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIUUIUIUIU


I contend that the results of firstTry and secondTry should be the same. What am I missing? Thanks.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: RegexkitLite - Possible bug?
      • From: John Engelhart <email@hidden>
  • Prev by Date: Bindings: NSMutableArray -> NSArrayController -> NSPopUp
  • Next by Date: Re: problem in display of leopard app on snowleopard
  • Previous by thread: Re: Bindings: NSMutableArray -> NSArrayController -> NSPopUp
  • Next by thread: Re: RegexkitLite - Possible bug?
  • Index(es):
    • Date
    • Thread