title: Need to split University Course code into prefix and suffix using regex
body: <p>I need to split a a university course code into prefix and suffix. e.g. CSE1011 into Prefix CSE and Suffix 1011 . Prefix may be 2 or more Alphabets and suffix may be none/ 3 or more. So far I have come up with this RegEx:</p>
  
  <pre><code>/([A-Z]{2,})(?:\s*)([0-9]{3,})?$/g
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var courscrCode = 'CSE1011';
  var courseRegex = /([A-Z]{2,})(?:\s*)([0-9]{3,})?$/g;
  var splitted = courseRegex.exec(courscrCode);
  console.log(splitted);</code></pre>
  </div>
  </div>
  </p>
  
  <p>Also tried This. I am getting more match</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var courscrCode = 'CSE1011';
  var courseRegex = /([A-Z]{2,})(?:\s*)([0-9]{3,})?$/g;
  
  if (courscrCode.match(courseRegex)) {
    var splitted = courscrCode.split(courseRegex);
    console.log(splitted.length);
    if (splitted.length &gt; 1) {
      splitted.forEach(function(value, index) {
        if ((value != '') &amp;&amp; (value != undefined))
          console.log(value, index);
      });
    }
  } else {
    console.log('course code mangled');
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I need a solution where i am going to get exactly 2 sub-string prefix and suffix. now I am getting more that 2. I am also open to any other solution</p>