Pavol Droba wrote:
On Wed, Jan 19, 2005 at 03:09:57PM -0500, Jeff Flinn wrote:
Am I required to use regex_finder to replace repeated chars with a single instance? I'm trying to cleanup a string for use with filesystem::path, for example:
C:\\abc///def\\ghi => C:\abc\def\ghi
There may be mixed forward and back-slashes. These are from environment variables that apparently are required by our use of NutCracker to support legacy apps under windows.
If I need to use regex_finder what are the benefits of the string_algo versus just using the regex library?
Actualy you can do it without regex. You need to use token_finder and find_format.
<code>
string strPath=find_format_all_copy( "C:\\abc\\def//ghi", token_finder(is_any_of("\\/"), token_compress_on), const_formatter("\\"));
//strPath == C:\abc\def\ghi
</code>
Great! I'm just having a little trouble finding my way around the library. I was stuck on looking for a replace algorithm variant to do what I needed. I need to spend an evening studying the doc's I see. One suggestion I have is to add to the Quick Reference table, the req'd header. This would help newbies(me) get up and running faster. Thanks, Jeff