• 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: Regular Expressions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regular Expressions?


  • Subject: Re: Regular Expressions?
  • From: Jason Stephenson <email@hidden>
  • Date: Fri, 06 Jun 2008 10:45:37 -0400

dream cat7 wrote:

I agree that to be able to use that syntax is highly desirable, and indeed missing from all the cocoa libraries that I have looked at. One way would be a category addition to NSString class, which would call the perl -pe 's/\b(.*?)/\u\L$1/g' for you and return the result as an NSString...


But unfortunately nobody has come up that type of an extension to NSString yet.
Or are there and c-libraries that will accept this s//// syntax ?

Would something like this be acceptable?

[someString replacePattern: @"\\b(.*?)" with: @"\\u\\L$1" flags: @"g"];

It is pretty much how I have considered handling substitions in the category that I'm designing.

As for string subs in C libraries, I really am only familiar with using the POSIX standard regex library. You can do that sort of thing in it, but it is not as simple as writing a single line of code.

I have some limited experience with PCRE, and IIRC the coding is more less the same there.

I don't know of any regex library that will accept s//// in a string. That's a bit of syntactic sugar that makes Perl so sweet. ;)

Cheers,
Jason
_______________________________________________

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: Regular Expressions?
      • From: Jason Stephenson <email@hidden>
References: 
 >Regular Expressions? (From: "Cemil Browne" <email@hidden>)
 >Re: Regular Expressions? (From: Citizen <email@hidden>)
 >Re: Regular Expressions? (From: "Cemil Browne" <email@hidden>)
 >Re: Regular Expressions? (From: dream cat7 <email@hidden>)
 >Re: Regular Expressions? (From: "Vincent E." <email@hidden>)
 >Re: Regular Expressions? (From: dream cat7 <email@hidden>)
 >Re: Regular Expressions? (From: "Vincent E." <email@hidden>)
 >Re: Regular Expressions? (From: dream cat7 <email@hidden>)

  • Prev by Date: Re: Converting a MenuRef to a NSMenu
  • Next by Date: how to build c++ file and create its instance in another objective-c class
  • Previous by thread: Re: Regular Expressions?
  • Next by thread: Re: Regular Expressions?
  • Index(es):
    • Date
    • Thread