Replacing a \t with something in a list
<pre><code>&gt;&gt;&gt;user_sentence = "hello \t how are you?"
&gt;&gt;&gt;import re
&gt;&gt;&gt;user_sentenceSplit = re.findall(r"([\s]|[\w']+|[.,!?;])",user_sentence)
&gt;&gt;&gt;print user_sentenceSplit
</code></pre>

<p>I get <code>['hello', '\t', 'how', 'are', 'you', '?']</code></p>

<p>I don't know how to create any code that will replace the <code>'\t'</code> with <code>'tab'</code>.</p>

<p>I think <code>str.replace</code> would do the job.</p>

<pre class="lang-py prettyprint-override"><code>user_sentence.replace('\t', 'tab')
</code></pre>

<p>Do this before splitting the string.</p>

python regex