Wildcard in NSString (fwd)
Wildcard in NSString (fwd)
- Subject: Wildcard in NSString (fwd)
- From: email@hidden
- Date: Fri, 04 Jul 2003 18:12:41 +0200
also i just found the omni group has classes for regular expressions, if u
go for anything more sophisticated...
I have two NSStrings, say, @"ABCD" and @"A*D". The '*' character in
the second
NSString is actually a wildcard. Is there any simple method, which,
when these
strings are compared, will return YES?
@protocol NSComparisonMethods
- (BOOL)isLike:(NSString *)string;
- (BOOL)isCaseInsensitiveLike:(NSString *)string;
@end
These methods do shell-style "globbing" of '*' and '?' characters, and have
working implementations in NSString.
I use them in BDQualifier <
http://bdistributed.com/Projects/BDControl/>.
-- Chris
-- Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.