• 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: Inverse Regex Library?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inverse Regex Library?


  • Subject: Re: Inverse Regex Library?
  • From: Erik Buck <email@hidden>
  • Date: Thu, 17 Jul 2008 08:18:35 -0700 (PDT)

You ask an interesting computer science question (that's unrelated to Cocoa).

  Surely the following sequence of words would produce Word[1-9]{1,2} instead of Word[0-9]{1,2} because there is no representative 0 in the sample ?

  "Word1"
"Word2"
"Word5"
"Word8"
"Word11"
"Word19"
"Word23"
"Word45"
"Word77"

  Anyway, I think this is an unsolvable problem, and I might start with an attempted proof of its unsolvability rather than a solution.  Lots of artificial intelligence and/or statistical pattern recognition could be applied to achieve reasonable results in general cases. If you have specific cases like letters followed by numbers you might use a lexer and parser like flex/bison.

  Have you considered a "perfect hash" ?  What are you really trying to achieve ?
  http://en.wikipedia.org/wiki/Perfect_hash_function
  http://www.nist.gov/dads/HTML/minimalPerfectHash.html


_______________________________________________

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

  • Follow-Ups:
    • Re: Inverse Regex Library?
      • From: Philip Mötteli <email@hidden>
    • Re: Inverse Regex Library?
      • From: "Vincent E." <email@hidden>
    • Re: Inverse Regex Library?
      • From: Giao Nguyen <email@hidden>
  • Prev by Date: Re: NSMessagePort Invalidation
  • Next by Date: Re: Where's the best place for addObserver and removeObserver
  • Previous by thread: Re: Inverse Regex Library?
  • Next by thread: Re: Inverse Regex Library?
  • Index(es):
    • Date
    • Thread