i have a map of key type string, but i have to search for the key with the longest possible string that matches a substring starting from a specific position in an input string. ex 0 in this:
"++c;"
matches the substring "++" that is found in the map even if there is a "+" in the map.

Will searching (lower bound) for the whole input string "++c;" be efficient even if it would be of size of several megabytes? I don't want the string to be copied or iterated more than nessesary, and this have to work with any substring of the input string. Would i have to make fake container that simulates a string but is actually a reference to a substring in the input string?