help using String Algorithms search and replace
I need to (among other tasks) un-encode some substitutions in a string that use URL-encoding. That is, locate all occurrences of "%nn" and replace with the character whose ordinal is 0xnn. I looked at boost/algorithm/string.hpp, but the instructions are not at all clear. The tutorial/example is too simple, and the reference it points to for more info is quite unenlightening. Could someone show me how to do that, or point to an example that's more along those lines? Thanks, --John ===begin corporate footer=== TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
On 10/28/2010 4:10 PM, John Dlugosz wrote:
I need to (among other tasks) un-encode some substitutions in a string that use URL-encoding. That is, locate all occurrences of “%nn” and replace with the character whose ordinal is 0xnn.
I looked at boost/algorithm/string.hpp, but the instructions are not at all clear. The tutorial/example is too simple, and the reference it points to for more info is quite unenlightening.
Could someone show me how to do that, or point to an example that’s more along those lines?
===begin corporate footer=== <snip> The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
I'm going to answer your question in spite of the potential dire legal
ramifications of doing so. PLEASE don't use sigs like this on this list.
Use Boost.Xpressive. It's the right tool for your job:
#include
===begin corporate footer=== <snip> The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
I'm going to answer your question in spite of the potential dire legal ramifications of doing so. PLEASE don't use sigs like this on this list.
I can't control that. The corporate types that set it up have no concept of net-etiquette, even though I'm sure they could condense it down to a few lines. The best I can do is apologize for it, and try and keep some whitespace before it after the real message end. Others have pointed out that such things have no legal standing anyway, since there are click-through waivers for joining mailing lists.
Use Boost.Xpressive. It's the right tool for your job:
Thanks for pointing that out. I was starting to think that it was more effort than it was worth for the task at hand. I've never used Xpressive before, so thanks for the complete solution.
= TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
participants (2)
-
Eric Niebler
-
John Dlugosz