• 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
Re: Regular Expressions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regular Expressions?


  • Subject: Re: Regular Expressions?
  • From: "Hamish Allan" <email@hidden>
  • Date: Fri, 6 Jun 2008 10:08:45 +0100

On Fri, Jun 6, 2008 at 8:31 AM, Cemil Browne <email@hidden> wrote:

> This might be a really silly question - but am I missing something obvious?
>  Is there any support at all for regular expressions in the Cocoa libraries?

You can use NSPredicate for regexp matching, though no substitution is possible:

NSPredicate *pred = [NSPredicate predicateWithFormat:@"self matches
%@", yourRegexp];
BOOL result = [pred evaluateWithObject:yourString];

Hamish
_______________________________________________

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

References: 
 >Regular Expressions? (From: "Cemil Browne" <email@hidden>)

  • Prev by Date: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects
  • Next by Date: Re: Regular Expressions?
  • Previous by thread: Re: Regular Expressions?
  • Next by thread: Re: Regular Expressions?
  • Index(es):
    • Date
    • Thread