title: Javascript Regex get elements from text
body: <p>I'm quite new to the javascript world an have no idea about regex; I hope you can help me with that one:</p>
  
  <p>I need a function that gives me the elements of a text-block that a user can input through an <code>&lt;input/</code> on a website, so i can output them to another <code>&lt;input/</code>.</p>
  
  <p>Generalized input:</p>
  
  <pre><code>txt1/txt2_txt3#txt4_txt5@txt6
  </code></pre>
  
  <p>Real input-example ("personalcode"):</p>
  
  <pre><code>user/855042,5_512125#2431072,25_729106@coursname optionaladdition
  </code></pre>
  
  <p>What I got so far is the html stuff and this (-yep thats not much):</p>
  
  <pre><code>var base= document.getElementsByName("personalcode")[0].value;
  </code></pre>
  
  <p>What I would need to get out is:</p>
  
  <pre><code>var one = txt1;    //always letters
  var two = txt2;    //always a decimal number
  var three = txt3;  //always a decimal number
  var four = txt4;   //always a decimal number
  var five = txt5;   //always a decimal number
  var six = txt6;    //can be letters and decimal numbers
  </code></pre>
  
  <p>There will never be special characters such as !"§$%&amp;/()=?+*# inside a text element. ö, ü, ä is possible.</p>
  
  <p>Example:</p>
  
  <pre><code>var one = user;
  var two = 855042,5;
  var three = 512125;
  var four = 2431072,25;
  var five = 729106;
  var six = coursname optionaladdition;
  </code></pre>
  
  <p>In the end I want to output it like this:</p>
  
  <pre><code>document.getElementsByName("output-user")[0].value= one;
  .
  .
  .
  </code></pre>
  
  <p>I hope you understand what I mean.</p>