Right, but that's a very trivial string replacement with no advanced modifications.

I had thing like this perl script for changing case to "word caps" in mind:
echo 'some test text' | perl -pe 's/\b(.*?)/\u\L$1/g'

search pattern would be "\b(.*?)"
replacement pattern would be "\u\L$1"

I would need something with capabilities like these.

On Jun 6, 2008, at 2:09 PM, dream cat7 wrote:


No that would require finding rangeOfRegex followed by a call to replaceCharactersInRange

        NSRange range = [theString rangeOfRegex:@"regex" capture:0];

        if( ! NSEqualRanges(range, ((NSRange){NSNotFound, 0} )) )               
        
                [theString replaceCharactersInRange:range 
withString:@"newstring"];


compare that to the RegexKit equivalent which is

- (NSString *)stringByMatching:(id)aRegex replace:(const RKUInteger)count withReferenceFormat:(NSString * const)referenceFormatString, ...;
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to