title: Less CSS - access part of class name and use in mixin
body: <p>In Less, is it possible to access part of a class name and use within a mixin?</p>
  
  <p>This will be best explained with an example:</p>
  
  <p>I have a grid which i have declared as follows:</p>
  
  <pre><code>.columns (@columns) {
      //code here to generate column widths
  }
  
  //This is where my problem is:
  .column-1 {
      .col (1)
  }
  .column-2 {
      .col (2)
  }
  .column-3 {
      .col (3)
  }
  // etc etc
  </code></pre>
  
  <p>Obviously there is a lot of repetitive code going on here.  Ideally i would like to be able to not have to declare column-1 column-2 etc and have some way, regex perhaps, of parsing the class name, and using the value after the dash to automatically calculate the column width.  I am almost certain twitter bootstrap is doing something similar but i cant understand it:</p>
  
  <pre><code>.spanX (@index) when (@index &gt; 0) {
        (~".span@{index}") { .span(@index); }
        .spanX(@index - 1);
      }
      .spanX (0) {}
  </code></pre>