title: Match starting characters of string
body: <p>I have string like:</p>
  
  <pre><code>/transaction/tran_id=123
  </code></pre>
  
  <p>I want to match <code>/transaction/</code> part of the string. if it's so then,</p>
  
  <pre><code>window.location.href = url;
  </code></pre>
  
  <p>else</p>
  
  <pre><code>alert("Not URL");
  </code></pre>
  
  <p>I tried with <code>str.match("^string")</code></p>