title: Regular Expression for Cron Expression in Javascript
body: <p>I'm trying to figure out a correct validation for custom cron inputs. Here's what I have.</p>
  
  <p>Html</p>
  
  <pre><code>&lt;input id="freqInput" type="text" placeholder="Enter CRONJOB" class="form-control" /&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>function isCronValid(freq) {
      var cronregex = new RegExp("/^(\*|((\*\/)?[1-5]?[0-9])) (\*|((\*\/)?[1-5]?[0-9])) (\*|((\*\/)?(1?[0-9]|2[0-3]))) (\*|((\*\/)?([1-9]|[12][0-9]|3[0-1]))) (\*|((\*\/)?([1-9]|1[0-2]))) (\*|((\*\/)?[0-6]))$/");
      return cronregex.test(freq);
  }
  </code></pre>
  
  <p>Am I missing something? It's not working.</p>
  
  <p>Controller</p>
  
  <pre><code>public string HangfireCronJob(string url, string freqInput)
  {
      return freqInput.ToString();  
  }
  </code></pre>