title: Attach string for matching substring
body: <p>I have the following string</p>
  <pre><code>test = &quot;if row['adm.w'] is 'Bad' and row['rem'] not empty&quot;
  </code></pre>
  <p>I want to add <code>str(...)</code> for those tokens which are <code>row[...]</code>, how can I do this in regex? I came up with this and it's not working as intended:</p>
  <pre><code>re.sub(r&quot;'([^row[']*)'&quot;, r&quot;str(['\1'])&quot;, test)
  </code></pre>
  <p>I want the end result to be</p>
  <pre><code>test = &quot;if str(row['adm.w']) is 'Bad' and str(row['rem']) not empty&quot;
  </code></pre>