ICS 225 Web Design and Implementation
Lab 4: Strings and Regular Expressions
Objectives: In
this lab, you will work with JavaScript
Part I. Practice with Regular Expressions
function checkpattern ( pat, str ) {
if ( str.match(pat) ) // if result is not null
alert ("Matched!");
else
alert ("No match");
}
Part II. Practice Some More with Regular Expressions
McFarland
has provided a regular expression sandbox which I have posted at: http://cs.metrostate.edu/~fitzgesu/courses/ics225/fall2009/examples/regexp/regex_tester.html
Play
with this regular expression tester. At a
minimum, create and test regular expressions for
Hint: see McFarland, pages 126-130