Re: Regular Expressions?
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