glibc already includes an regexp library. If you want to do this (and I would really appreciate some octstr_reg_match and octstr_reg_replace ;)) you should create an abstraction layer in gwlib/ and compile it against glibc or against others - for *bsd and solaris?.
Ok, attached is a tentative patch against gwlib/octstr.c adding octstr_reg_matches(Octstr *haystack, Octstr *needle) where needle is
a regexp pattern. Returns 0 on hit, 1 on miss or -1 on invalid pattern.
See "man 7 regex" for regex syntax info.
If that sort of thing is satisfactory, I'm thinking returning a List object from an 'octstr_reg_getmatches' would probably be useful, and just the modified Octstr* from octstr_reg_replace?
Cheers, _Gus
-- Angus M Wood Chief Architect Inspired Broadcast Networks http://www.inspiredbroadcast.net/ Out of Home Pay to Play Networked Entertainment 1-7 Livonia Street, London, W1F 8AD, UK Tel: +44 (0)20 7478 8280 Mob: +44 (0)7767 393039 Fax: +44 (0)20 7287 0131
test_octstr_regexp.c
Description: Binary data
regexp.patch
Description: Binary data