Bernd Eilers wrote:

Hi there!

Just two possibly incompatible thoughts on that:

1.) What about using regular expressions like you can do in java or perl with the search string being a regular expression and the replacement String having the possibility to contain /$1 /$2 /$3 etc. with the meaning to replace with the match found for the n-th group surrounded by brackets inside the regular expression?

Not sure how that relates to the problem of replacing placeholders in a fixed text with dynamic content.

The Boost library which AFAIK we already use for something else does contain support for regular expressions.

Have a look at:

http://www.boost.org/libs/regex/doc/index.html
http://www.boost.org/libs/regex/doc/non_standard_strings.html


2.) What about using arrays of Strings as arguments instead of just Strings? This would be adding the possiblity to replace multiple patterns at the same time while eliminating your problem one mentioned as well. And it will likely be faster than multiple calls to one replace method with different patterns and replacements.


Kind regards,
Bernd Eilers

Yes, functionality to solve the above problem ("replacing placeholders in a fixed text with dynamic content") would probably use some sort of dictionary to map different placeholders to actual content, and do the complete conversion in one call. But that is somewhat off topic; all I wanted this thread for is to argue that adding some searchAndReplace to rtl::OUString is probably not as useful as it might appear at first sight. How the functionality really asked for in the corresponding issue should be implemented is worth another thread.

-Stephan

[...]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to