• 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: Searching for "whole word" in NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Searching for "whole word" in NSString


  • Subject: Re: Searching for "whole word" in NSString
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 29 Jan 2008 12:05:09 -0800


On Jan 29, 2008, at 11:38 AM, John Stiles wrote:

Oh well, off to Radar to file a bug on the Find panel, and I'll figure out some sort of solution. I can probably use NSCharacterSet or something and look at the characters on either side of the found text. I was hoping to avoid that, but it looks like I can't.

You should still be able to build on doubleClickAtIndex: to determine word boundaries at either end of your search string and in the found text, and then implement whatever boundary-matching semantics you choose on top of that, without having to use NSCharacterSet or anything of the sort. Word boundary detection is complicated enough (cf. UAX #29, "Text Boundaries", at http://www.unicode.org/reports/tr29/) that you really don't want to have to implement it yourself.


Douglas Davidson

_______________________________________________

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: 
 >Searching for "whole word" in NSString (From: John Stiles <email@hidden>)
 >Re: Searching for "whole word" in NSString (From: Citizen <email@hidden>)
 >Re: Searching for "whole word" in NSString (From: Douglas Davidson <email@hidden>)
 >Re: Searching for "whole word" in NSString (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Searching for "whole word" in NSString
  • Next by Date: Re: Searching for "whole word" in NSString
  • Previous by thread: Re: Searching for "whole word" in NSString
  • Next by thread: Re: Searching for "whole word" in NSString
  • Index(es):
    • Date
    • Thread