title: tcl regex inside string map
body: <p>I got a template which I want to transform into a tex file. For example each chapter and section which contains a dot and a letter I want to replace it with a backslash and the letter. I know I can try using regsub, but I really want to try it with string map, here is the code which is not working:</p>
  
  <pre><code>set main \
  {
  .chapter{Assignment 1}
  .section{1a}
  }
  set main [string map {.({^[A-Za-z]+$})\1 \\\1} $main]
  </code></pre>
  
  <p>It will be easier to do just: </p>
  
  <pre><code>set main [string map {.c \\c} $main]
  set main [string map {.s \\s} $main]
  </code></pre>
  
  <p>But I just want to try using the {any letter thingy} and to know if is possible using the <code>string map</code> command.</p>