[sorno_replace_thrift_const] More precise passing of constants

Summary:
Tokenize a string by word and non-word characters. A word character is
an alphanumberic character or an underscore. This is much better than parsing
white vs non-white characters before.