HTML and CSS Reference
Figure 17.12 The user entered Steven lives in Cleveland , one uppercase letter [A-
Z] , followed by one lowercase letter [a-z] , followed by eve . This matches both
Steven and Cleveland .
Figure 17.13 When the user entered Believe! (top), it didn't match (bottom).
Would it have matched if he or she had entered BeLieve . Why?
<head><title>The Character Class</title></head>
// Character class
var reg_expression = /[A-Za-z0-9_]/; // A single alphanumeric
// word character
var textString=prompt("Type a string of text","");
var result=reg_expression.test(textString); // Returns true
// or false