Skip navigation.
 
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
FROM : Alastair Houghton
DATE : Tue Sep 11 12:03:44 2007

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

Related mailsAuthorDate
ml[ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John Engelhart Sep 1, 21:49
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John C. Randolph Sep 1, 23:20
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alastair Houghton Sep 3, 01:12
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Ilan Volow Sep 5, 16:08
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Thomas Clément Sep 5, 17:29
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alexey Zakhlestin Sep 5, 17:51
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library j o a r Sep 5, 17:58
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alastair Houghton Sep 5, 18:00
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Chris Hanson Sep 5, 20:59
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Seth Willits Sep 5, 21:42
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Michael Watson Sep 6, 09:02
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 6, 16:05
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Shawn Erickson Sep 6, 16:18
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 6, 16:32
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Deborah Goldsmith Sep 11, 04:09
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John Stiles Sep 11, 04:46
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 11, 05:16
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John C. Randolph Sep 11, 06:33
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alastair Houghton Sep 11, 12:03
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Ilan Volow Sep 11, 16:19
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 11, 18:16
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 11, 18:39
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John Stiles Sep 11, 18:42
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alastair Houghton Sep 11, 19:02
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John Stiles Sep 11, 19:05
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Alastair Houghton Sep 11, 19:21
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library John Stiles Sep 11, 19:27
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Mark Munz Sep 11, 19:53
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library cocoa-dev-admins… Sep 11, 20:21
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library cocoa-dev-admins Sep 11, 20:23
mlRe: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library Thomas Engelmeier Sep 12, 13:41