hard to say, its up to the engine implementing regex, if you want to
check for ascii code of each character you gonnamake a loop
like
function isAscii(str){
for(i=0;i<str.length;i++){
if(str[i]>127)return false;
}
return true;
}
when making regex its like a touring machine which scans the character
applied to the pattern, so it also depends on a pattern how many chars
are scanned, and in your case you want to know if a character is in
ascii range, so anyway it has to scan each. there is one chance regex
is faster inthis case, if its implemented natively and not
interpreted.
the loop above has the advantage is has not to scan all of the chars,
in case its not ascii but returns after first non-ascii