Re: Core Data Fetch Error
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