• 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
Wildcard in NSString (fwd)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Re: Wildcard in NSString
  • Next by Date: How to pause another application or even thread
  • Previous by thread: Re: arithmetic in Cocoa
  • Next by thread: How to pause another application or even thread
  • Index(es):
    • Date
    • Thread