title: Regex vs. Manual comparison. Which is faster?
body: <p>in writing a scripting engine, I have functions like (psuedo-code)</p>
  
  <pre><code>function is_whitespace?(char c){
    return c==' ' || c=='\t' || c=='\r' || c=='\n';
  }
  </code></pre>
  
  <p>Well, my question is which is faster in most langugaes? That or using regex like</p>
  
  <pre><code>function is_whitespace?(char c){
    return regex_match('\s',c);
  }
  </code></pre>
  
  <p>The chief languages I'm concerned with are C#, C, and Ruby also in case it is completely platform-dependent. </p>