Re: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
Re: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
- Subject: Re: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
- From: Alastair Houghton <email@hidden>
- Date: Tue, 11 Sep 2007 11:03:44 +0100
On 11 Sep 2007, at 03:46, John Stiles wrote:
Hmm. Well, that's a reasonable obstacle. But still, it seems as if
Apple could have implemented it the "slow" way for now (where it
converts each string to a buffer before regex'ing it),
Actually you don't need to do that in all cases. You can use
CFStringGetCharactersPtr() to try to get a UTF-16 character pointer
for the string, and then fall back to allocating a buffer if/when
that fails.
Unfortunately I have a suspicion that the function always fails for
string constants...
On 11 Sep 2007, at 04:16, Mark Munz wrote:
We definitely want this to happen, but it's a lot of work. This is
the current roadblock:
http://bugs.icu-project.org/trac/ticket/4521
While it may be a lot of work, but it also looks like the issue has
pushed off again and again as the bug has been open for two years.
Since anyone is free to contribute to ICU, if you particularly care
about it, you could offer your assistance to fix it. Indeed, any of
us could have any time over the past two years. It looks from the
ticket though that IBM, Apple and Google all have people working on
the problem right now---at least, I'm guessing that that's what the
"load" property means.
It definitely seems like great is the enemy of good here.
I think that viewpoint is hard to defend.
It's always been possible for developers to use regexps in their own
code, whether by using the POSIX functions, or by linking in a third
party library (Oniguruma probably being the best match for Cocoa
strings right now as it has native UTF-16 support). Is it fair,
therefore, to criticise Apple for electing to wait until the ICU
implementation had all the features they felt they needed for really
great regexp support? I don't think so. It isn't exactly a huge
effort using a third-party library for now.
Put another way, since we have plenty of options right now, why rush
to make an official "NSRegularExpression" (or CFRegularExpression...)
before there's a significant advantage in doing so?
I would also guess that the regexp issue has had more bugs filed
against it in recent months because it seems that more people are
coming from scripting languages where regexps are widely available,
as opposed to C where they're really only available on Unix-like
systems (or with a third-party library...).
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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