• 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: Xcode Editor's Regex now uses PCRE instead of ICU?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode Editor's Regex now uses PCRE instead of ICU?


  • Subject: Re: Xcode Editor's Regex now uses PCRE instead of ICU?
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 10 Mar 2008 20:28:16 -0700

On 2008 Mar, 07, at 15:23, David Ewing wrote:

Nope. We Use ICU, and that hasn't changed. I can't speak to the documentation, but the caret operator has been standard in Regex's for decades.

David, someone is lying to you.  Please try this.

From   http://www.pcre.org/pcre.txt   read:

"a backslash followed by a digit greater than 0 (and possibly further digits) is a back reference to a capturing sub- pattern"

From http://www.icu-project.org/userguide/regexp.html  read:

$n  The text of capture group n will be substituted for $n."

So, we have here a clear nonambiguous difference between PCRE and ICU.  PCRE uses \n to reference capture groups and ICU uses $n.

Now, let's see which Xcode uses.  Open a text file that has a "#import" statement near the beginning.  We're going to try and change #import to #important

Click ⌘F to get Single File Find.
In the "Find:" field, enter:      (import)
In the "Replace" field, enter:    \1ant
Click "Next" and then "Replace".
Result:  #import gets changed to #important.
Conclusion: It worked.  It's PCRE.

Now, in "Replace", change to:     $1ant
Scroll to top ot file, click "Next" and "Replace" again.
Result:  #import gets changed to  #$1ant
Conclusion: It didn't work.  It ain't ICU.

This is the clearest example, but there are others, like the one I wrote about in this thread last week.  Whenever there is a conflict between ICU and PCRE documentation, the PCRE documentation is the one that works in Xcode.  I've already filed a bug on this a few weeks ago, but I'm just re-posting here to set the record straight.  Maybe one of your Perl fans in Cupertino slipped the PCRE library in place of ICU while no one was looking?

Jerry Krinock
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Xcode Editor's Regex now uses PCRE instead of ICU?
      • From: "Clark Cox" <email@hidden>
    • Re: Xcode Editor's Regex now uses PCRE instead of ICU?
      • From: Bill Royds <email@hidden>
References: 
 >Xcode Editor's Regex now uses PCRE instead of ICU? (From: Jerry Krinock <email@hidden>)
 >Re: Xcode Editor's Regex now uses PCRE instead of ICU? (From: David Ewing <email@hidden>)

  • Prev by Date: Re: Subversion and nib files workaround?
  • Next by Date: Re: Xcode Editor's Regex now uses PCRE instead of ICU?
  • Previous by thread: Re: Xcode Editor's Regex now uses PCRE instead of ICU?
  • Next by thread: Re: Xcode Editor's Regex now uses PCRE instead of ICU?
  • Index(es):
    • Date
    • Thread