[ANN] AGRegex-0.2
[ANN] AGRegex-0.2
- Subject: [ANN] AGRegex-0.2
- From: Aram Greenman <email@hidden>
- Date: Thu, 13 Feb 2003 19:02:21 -0800
AGRegex provides Perl-compatible regular expressions to Cocoa
applications using Philip Hazel's PCRE library.
Here is a code example of a simple match case.
AGRegex *re = [[AGRegex alloc] initWithPattern:@"(paran|andr)oid"
options:AGRegexCaseInsensitive];
AGRegexMatch *m = [re findInString:@"paranoid android"];
NSString *str = [m group], *sub = [m groupAtIndex:1];
str now contains "paranoid", and sub contains "paran". Here is a code
example of a simple pattern substitution.
AGRegex *re = [[AGRegex alloc] initWithPattern:@"[usr]"];
NSString *str = [re replaceWithString:@"\\u$&." inString:@"Back in the
ussr"];
str now contains "Back in the U.S.S.R.".
New in this version:
- Now provides -initWithPattern:options:encoding: to allow handling of
non-ASCII strings, still no support for multi-byte encodings, sorry.
- AGRegexMatch is more resource-efficient, not that is was exactly a
hog before, but anyway...
- Necessary files from PCRE have been added directly to the project,
no longer builds libpcre in a separate build phase.
Source code is available under terms of the BSD license from the
project page at SourceForge:
http://sourceforge.net/projects/agkit
or by anonymous CVS:
cvs -d:pserver:email@hidden:/cvsroot/agkit login
cvs -z3 -d:pserver:email@hidden:/cvsroot/agkit co
AGRegex
Special thanks to Robert Klep and Jamie Hodkinson for bug reports and
lab rat services.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.