Re: [Dev-C++] Regular expressions: string substitution with pcre or any other library?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Reid T. <rei...@at...> - 2006-02-15 14:36:52
|
Bernd Muent wrote: > Hi together, > most of the time I'm using .net framework to programm C++. > F.E. I can do the following: > > Regex* rex; > String* > replacedTags=rex->Replace(originalLine,S"<(.*)?>,S"<SPECIAL>$1</SPECIAL>"); > > > For a special program I would like to do the same in a standard C++ > program. > I found the library pcre and after some starting problems I'm able to > compile and link to it. > But with this library I can only test if a string matches to a pattern > and extract the corresponding substring. > I think I would be able to write a function for replacing this > substring, but there must have someone before me who did this work > already ;-) > > Searching with google "pcre string replace substitute" or whatever I > did not find any solution for pcre nor any other library for the same > thing (it must be a library which can be used with Windows XP). > > Thank you for any hints, Bernd > > never used them myself, but the boost libraries may be very helpful... http://www.boost.org/libs/regex/doc/regex_replace.html http://www.boost.org/index.htm |