[C++] Refactor pattern functions in strutil
5 files changed