Please help me understand regular expressions. I have read different
articles about them, they all seem to explain it differently.
1.
On one site it says to do it like this:
return ( /^[0-9]+$/.test(num) )
2.
On another it says:
var regExp = new RegExp(/^[a-zA-Z0-9]+$/)
return ( regExp.test(str) )
3.
I see others that put the expression into a string and then test it.
I have tried both 1 and 2, and on some clients 2 will work, but on
others it always returns false no matter what. What's the difference
between them? How do I know what is going to work on all clients?
Is there a way to find out exactly what version of Javascript is being
used on the client. Not from code, but just by looking somewhere on
the machine. A lot of what I am trying to write this for is websites
to be used internally.
I appreciate your time.
Kalvin