extract commond code into helper change replace to use rexp Update docstring
extract commond code into helper
change replace to use rexp
Update docstring

Willyham/tchannel-python,uber/tchannel-python,uber/tchannel-python,Willyham/tchannel-python