Validation Made Simple with JScript Regular Expressions Heidi Housten One overlooked feature of JScript is the regular expression interpreter, which makes string pattern matching easy. O ne of the new and exciting features of Microsoft JScript version 3.0 that receives very little attention is the regular expression object. If you know Perl, you're already familiar with these very powerful and simple objects, designed to make pattern matching easy. Let's see how to implement them in JScript.
Input validation is one of the most common requirements in Web site development.
At design time, you don't know what exact values viewers will enter, but you do know the format they should be in. For example, let's say I want users to input 6 digits followed by a decimal and 4 more digits. The characters . To use one of these special characters as a match character in a regular expression, you must precede it with a backslash. You can specify the number of times you expect something to appear by specifying a number in curly brackets.