title: How to copy a HTML tag parameter value into another parameter of the same tag (for every tag in the source text)?
body: <p>I have got a huge HTML form where all the inputs have the <code>name</code> parameters set. I would like to also set <code>id</code> (to be equal to the name) for every input. Manual copying and pasting would be nasty as there are too many inputs actually. Of course I can write a program that would parse the tags and do just this but this looks a bit overkill too. Any suggestions?</p>
  
  <p>UPDATE: I mean doing it at the HTML source code level rather than in the run time.</p>
  
  <p>UPDATE2: The task actually means replacing every occurrence of the <code>name="my-field"</code> pattern (where there can be anything reasonable in place of <code>my-field</code> (but will contain the minus usually, so supporting just letters is not enough)) with <code>name="my-field" id="my-field"</code>. I believe this can be done with something like <code>sed</code> but to my shame I am hardly proficient in regular expressions.</p>