Regular Expressions: A Workaround - Doc JavaScript | WebReference

Regular Expressions: A Workaround - Doc JavaScript


JavaScript Regular Expressions

A Workaround

If the user is running a browser that supports JavaScript but doesn't support regular expressions, an error is generated. The browser's JavaScript interpreter encounters an unrecognized literal (/.../) and reports an error. One can use either the RegExp() constructor or the eval() function instead. We'll use the first one.

First, take a look at our solution, which includes validation for older browsers that do not support regular expressions:

Your e-mail address:

Subject:

Comments: