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>It is behavior of Python's compiler. You should not be worrying about it. Pyhton's Compiler store <code>tab</code> as <code>\t</code>. You need not to do anything on it as it will treat it as tab while performing any action over it. For example:</p>

<pre><code>&gt;&gt;&gt; my_string = 'Yes    Hello   So?'  # &lt;- String with tab
&gt;&gt;&gt; my_string  
'Yes\tHello\tSo?'    # &lt;- Stored tab as '\t'
&gt;&gt;&gt; print my_string
Yes Hello   So?   # While printing, again tab
</code></pre>

<p>However you exact requirement is not clear to me. In case you want to replace the value of <code>\t</code> with <code>tab</code> string, you may do:</p>

<pre><code>&gt;&gt;&gt; my_string = my_string.replace('\t', 'tab')
&gt;&gt;&gt; my_string
'YestabHellotabSo?'
</code></pre>

<p>where <code>my_string</code> is holding the value I mentioned in previous example.</p>

python regex