
module("About Regular Expressions (topics/about_regular_expressions.js)");

test("exec", function() {
    var numberFinder = /(\d).*(\d)/;
    var results = numberFinder.exec("what if 6 turned out to be 9?");
    ok(results.equalTo([__, __, __]), 'what is the value of results?');		
});

test("test", function() {
    var containsSelect = /select/.test("  select * from users ");
    equal(__, containsSelect, 'does the string provided contain "select"?');
});

test("match", function() {
    var matches = "what if 6 turned out to be 9?".match(/(\d)/g);
    ok(matches.equalTo([__, __]), 'what is the value of matches?');
});

test("replace", function() {
    var pie = "apple pie".replace("apple", "strawberry");
    equal(__, pie, 'what is the value of pie?');

    pie = "what if 6 turned out to be 9?".replace(/\d/g, function(number) { // the second parameter can be a string or a function
        var map = {'6': 'six','9': 'nine'};
        return map[number];
    });
    equal(__, pie, 'what is the value of pie?');
});

// THE END

@@ -231,18 +231,40 @@
 To(%5B
-__, __, __
+'6 turned out to be 9', '6', '9'
 %5D), 
@@ -406,18 +406,20 @@
   equal(
-__
+true
 , contai
@@ -601,14 +601,16 @@
 To(%5B
-__, __
+'6', '9'
 %5D), 
@@ -737,34 +737,48 @@
 ry%22);%0A    equal(
-__
+%22strawberry pie%22
 , pie, 'what is 
@@ -1023,10 +1023,44 @@
 ual(
-__
+%22what if six turned out to be nine?%22
 , pi

Complete regular expressions tests to pass