• 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: Core Data Fetch Error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data Fetch Error


  • Subject: Re: Core Data Fetch Error
  • From: Chris Hanson <email@hidden>
  • Date: Fri, 10 Mar 2006 16:12:48 -0800

On Mar 10, 2006, at 3:50 PM, Greg Herlihy wrote:

I would add an NSLog(@"searchText is %@", searchText) to this routine since
it seems evident that searchText inadvertently contains at least one regular
expression metacharacter. I would guess a "." (period) as the most likely
candidate- after all, is "Korea" really the full text? Not "N. Korea" or "S.
Korea"?

The predicate LIKE operator does not use a regular expression. It uses a shell-style pattern match (optionally case and/or diacritic- insensitive) supporting only ? to match a single character and * to match zero or more characters.


The predicate MATCHES operator is an ICU regular expression.

You should not need to escape characters other than ? and * when using the predicate LIKE operator.

One way to avoid the regular expression parsing would be to specify
"CONTAINS" instead of "LIKE" for the match. In fact there seems little
reason to perform a "LIKE" search unless the search text does in fact
contain a regular expression.

The predicate CONTAINS operator, like the =/== operator, does not support case- or diacritic-insensitive string matching.


  -- Chris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Core Data Fetch Error
      • From: Ashley Clark <email@hidden>
    • Re: Core Data Fetch Error
      • From: Chris Hanson <email@hidden>
References: 
 >Re: Core Data Fetch Error (From: Greg Herlihy <email@hidden>)

  • Prev by Date: Re: Core Data Fetch Error
  • Next by Date: MDSchemaCopyDisplayNameForAttribute vs. CFPropertyListCreateFromXMLData
  • Previous by thread: Re: Core Data Fetch Error
  • Next by thread: Re: Core Data Fetch Error
  • Index(es):
    • Date
    • Thread