RegexkitLite - Possible bug?
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