implement the URL match in C++
Given a list of URLs, such as开发者_如何学Python a/b/e/f, b/c/d/k/g, s/e/c/d, how to match an input URL to the one in the list, for example, an input c/d should be matched to s/e/c/d, not b/c/d/k/g
Why not b/c/d/k/g? Are the "Url"s simply strings? If so simply search it using strstr or one of its derivative (wcsstr, _mbsstr, _mbsstr_l).
Just check if input is equal to input.size() trailing characters in the possible url match.
精彩评论