Skip to content

Commit 3720629

Browse files
author
Afshin Mokhtari
committed
all done.
1 parent 9df32de commit 3720629

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

topics/about_regular_expressions.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ module("About Regular Expressions (topics/about_regular_expressions.js)");
44
test("exec", function() {
55
var numberFinder = /(\d).*(\d)/;
66
var results = numberFinder.exec("what if 6 turned out to be 9?");
7-
ok(results.equalTo([__, __, __]), 'what is the value of results?');
7+
ok(results.equalTo(["6 turned out to be 9", '6', '9']), 'what is the value of results?');
88
});
99

1010
test("test", function() {
1111
var containsSelect = /select/.test(" select * from users ");
12-
equal(__, containsSelect, 'does the string provided contain "select"?');
12+
equal(true, containsSelect, 'does the string provided contain "select"?');
1313
});
1414

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

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

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

3131
// THE END

0 commit comments

Comments
 (0)