Skip to content

Commit 1ed58e3

Browse files
committed
Fix misinformation about being able to omit the number before the comma
in regexp repeat ranges in chapter 9.
1 parent b5137c8 commit 1ed58e3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

09_regexp.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ console.log(dateTime.test("30-1-2003 8:45"));
252252
// → true
253253
----
254254

255-
You can also specify open-ended ((range))s when using ((curly
256-
braces)) by omitting the number on either side of the comma. So
257-
`{,5}` means zero to five times, and `{5,}` means five or more times.
255+
You can also specify open-ended ((range))s when using ((curly braces))
256+
by omitting the number after the comma. So `{5,}` means five or more
257+
times.
258258

259259
== Grouping subexpressions ==
260260

html/errata.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ <h2>Chapter 2</h2>
3838

3939
<h2>Chapter 9</h2>
4040

41+
<p><strong>Page 157</strong> (Repeating Parts of a Pattern): The
42+
paragraph at the top of the page claims that `{,5}` is equivalent to
43+
`{0,5}` in a regular expression. This is not the case (you have to
44+
include the zero).</p>
45+
4146
<p><strong>Page 159</strong> (The Date Type¹):
4247
The <code>findDate</code> function produces the wrong months. The
4348
second argument given to <code>new Date</code> should

0 commit comments

Comments
 (0)