HELP: pair-value search & replace?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andwan0
    New Member
    • Jun 2009
    • 7

    HELP: pair-value search & replace?

    Does anyone know to quickly make a multiple search & replace app (in either C or C++)? Am not interested in searching multiple files, just one file. I want to translate a list of unicode characters into something else (pair-value lookup table) ... so it's basically a crude/naive translator!

    I just need a quick pseudocode to get me started. Or maybe there's an opensource/free code already written?

    PS: Or maybe it's easier quicker with sed/awk/perl?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Put your pair values in a C++ multimap.

    Then use the equal_range algorithm to get the begin/end iterators for the multiple keys.

    Just iterate between the iterators.

    Comment

    Working...