Skip to content

Commit 0e72735

Browse files
committed
Clarify exercise in Chapter 9
1 parent 0c9c569 commit 0e72735

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

09_regexp.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,11 +1248,10 @@ with the way it responds to various input strings.
12481248

12491249
{{index "program size", "code golf", "regexp golf (exercise)"}}
12501250

1251-
_Code
1252-
golf_ is a term used for the game of trying to express a particular
1253-
program in as few characters as possible. Similarly, _regexp golf_ is
1254-
the practice of writing as tiny a regular expression as possible to
1255-
match a given pattern, and _only_ that pattern.
1251+
_Code golf_ is a term used for the game of trying to express a
1252+
particular program in as few characters as possible. Similarly,
1253+
_regexp golf_ is the practice of writing as tiny a regular expression
1254+
as possible to match a given pattern, and _only_ that pattern.
12561255

12571256
{{index boundary, matching}}
12581257

@@ -1269,7 +1268,7 @@ make it any smaller.
12691268
4. Any word ending in _ious_
12701269
5. A whitespace character followed by a period, comma, colon, or semicolon
12711270
6. A word longer than six letters
1272-
7. A word without the letter _e_
1271+
7. A word without the letter _e_ (or _E_)
12731272

12741273
Refer to the table in the [chapter summary](regexp#summary_regexp) for
12751274
help. Test each solution with a few test strings.
@@ -1304,7 +1303,7 @@ verify(/.../,
13041303
13051304
verify(/.../,
13061305
["red platypus", "wobbling nest"],
1307-
["earth bed", "learning ape"]);
1306+
["earth bed", "learning ape", "BEET"]);
13081307
13091308
13101309
function verify(regexp, yes, no) {

code/solutions/09_1_regexp_golf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ verify(/\w{7,}/,
2626

2727
verify(/\b[^\We]+\b/i,
2828
["red platypus", "wobbling nest"],
29-
["earth bed", "learning ape"]);
29+
["earth bed", "learning ape", "BEET"]);
3030

3131

3232
function verify(regexp, yes, no) {

0 commit comments

Comments
 (0)