pandas.DataFrame.replace with wildcards
<p>Does the <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.replace.html" rel="nofollow"><code>pandas.DataFrame.replace</code></a> regex replace support wildcards and "capture groups"?</p>

<p>E.g., to replace <code>([A-Z])(\w+)</code> with <code>\2\1</code>?</p>

<p>What kind of regular expression is supported? Does Perl's regex supported? E.g., OK to replace <code>([A-Z])(\w+)</code> with <code>\l\1\2</code> (<code>\l</code>: <em>Change the next character to lowercase</em>.)</p>

<p><strong>UPDATE:</strong></p>

<p>As Steve has pointed out, according to the <a href="https://docs.python.org/2/library/re.html" rel="nofollow">Python documentation</a>, it should work, but the following is not giving me what I expected:</p>

<pre><code>df = pd.DataFrame({'A': np.random.choice(['foo', 'bar'], 100),
                   'B': np.random.choice(['one', 'two', 'three'], 100),
                   'C': np.random.choice(['I1', 'I2', 'I3', 'I4'], 100),
                   'D': np.random.randint(-10,11,100),
                   'E': np.random.randn(100)})
df.replace("f(.)(.)","b\1\2", regex=True,inplace=True)
</code></pre>

<p>What's wrong? </p>

<p>Thx</p>