when writing a script engine, I have features like (psuedo-code)
function is_whitespace?(char c){ return c==' ' || c=='\t' || c=='\r' || c=='\n'; }
Ok, my question is, which is faster in most langugaes? This is either using regular expression, for example
function is_whitespace?(char c){ return regex_match('\s',c); }
The main languages โโI deal with are C #, C, and Ruby, even if they are completely platform dependent.
performance regex parsing
Earlz
source share