FROM : Andrew Farmer
DATE : Fri Nov 26 23:07:15 2004
On 26 Nov 2004, at 10:44, Oliver Cameron wrote:
> Not sure if my other mail got through to the list, so I'll try again.
It did.
> I've been told I can use regex.h for powering the regular expression
> searches in my app. I'm never actually touched pure C code (is regex.h
> C?),
Yup.
> so I've really got no idea how to implement it in a Cocoa based
> application...
>
> I understand all the theory work, but I'm still at a lost as to how to
> use these functions, for example, in Obj-C, I would do something like:
>
> NSString *hello = [regex parseString:@"hello"
> withExpression:expression];
Nope. C functions use C strings. There are no ObjC calls involved here,
just function calls.
See here for a pure-C example:
> http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/
> genprogc/internationalized_reg_expression_subr.htm
and remember that + (NSString) stringWithCString; and - (NSString)
cString; are your friends.
DATE : Fri Nov 26 23:07:15 2004
On 26 Nov 2004, at 10:44, Oliver Cameron wrote:
> Not sure if my other mail got through to the list, so I'll try again.
It did.
> I've been told I can use regex.h for powering the regular expression
> searches in my app. I'm never actually touched pure C code (is regex.h
> C?),
Yup.
> so I've really got no idea how to implement it in a Cocoa based
> application...
>
> I understand all the theory work, but I'm still at a lost as to how to
> use these functions, for example, in Obj-C, I would do something like:
>
> NSString *hello = [regex parseString:@"hello"
> withExpression:expression];
Nope. C functions use C strings. There are no ObjC calls involved here,
just function calls.
See here for a pure-C example:
> http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/
> genprogc/internationalized_reg_expression_subr.htm
and remember that + (NSString) stringWithCString; and - (NSString)
cString; are your friends.
| Related mails | Author | Date |
|---|---|---|
| Oliver Cameron | Nov 26, 12:19 | |
| Oliver Cameron | Nov 26, 19:44 | |
| Glenn Andreas | Nov 26, 23:00 | |
| Andrew Farmer | Nov 26, 23:07 | |
| Guy English | Nov 26, 23:52 | |
| mmalcolm crawford | Nov 26, 23:58 | |
| Matthew | Dec 10, 23:11 | |
| Chris Eplett | Dec 14, 13:47 |






Cocoa mail archive

