return to the main page Mastering Regular Expressions
Second Edition

Errata
Last updated 02-May-2003.
Please see my contact information if you'd like to send in an erratum.

Most errata are just inconsequential typos or grammar nits, but there are also some factual mistakes that cause confusion during a close reading. In the list below, the factual mistakes are marked like this.


pxvi, end of first para

Printed:...most from them -- maintained as important...
Fixed:...most from them -- remained as important...
Reported by Thomas Pawlikaniec, 29-Mar-2003

pxviii, second-to-last paragraph

Printed:Understanding the details of how a regular expressions are handled...
Fixed:Understanding the details of how regular expressions are handled...
Reported by Mohammed Khatib, 14-Sep-2002

p11, second-to-last line

Printed:..., it they would be the...
Fixed:..., they would be the...
Reported by Paul Garner, 10-Aug-2002

p21 footnote

Apparently, there are a number of other egreps that exhibit this bug, including those on Solaris and SGI's Irix. (Perhaps they are derived from GNU's?)
Reported by Andreas Karrer, 6-Nov-2002

p25, center para, and in subsequent command line

Printed:[-a-z0-9_:@&?=+,.!/~*'%$]*
Fixed:[-a-z0-9_:@&?=+,.!/~*%$]*
Without this change, the command can't be executed. There are perhaps more technically appropriate ways to fix this, but it's not worth the confusion at this point in the book. Practically speaking, quotes rarely appear within urls, so it's not a loss.
Reported by Andreas Karrer, 6-Nov-2002

p28, last paragraph

Printed:...include Python, many Java regex package, Microsoft's .NET...
Fixed:...include Python, many Java regex packages, Microsoft's .NET...
Reported by Terry Jones, 7-Aug-2002

p35, 2nd to last line

Printed:Perl (as well...) tend to provide...
Fixed:Perl (as well...) tends to provide...
Reported by Laurent Dami, 20-Nov-2002

p39, bottom

Printed:As it turns out, Perl's simple print isn't so good when it comes to floating-point numbers
Fixed:As it turns out (at least on some systems), Perl's simple print is sometimes not so good when it comes to floating-point numbers
This example as shown puts me in somewhat of a pickel. The output at the bottom of the page shows "22 C is 71.5999999943116 F". I'm not sure how system-dependent this is, but with Perl 5.8 on my Intel-CPU box, it prints out "71.6" rather than what's shown. (Prior versions of Perl do show the 71.5999999943116 result.)

The change in Perl between 5.6 and 5.8 causes the example shown in the book to be wrong (for some systems?), but there are still many times where Perl would print out results similar to the 71.5999999943116 shown. For example, if the calculation in the example is swapped (from Fahrenheit to Celsius), then on my system the results are often like the 71.5999999943116 shown in the example.

Reported by Andreas Karrer, 6-Nov-2002

Printed:22 CPerl (as well...) tend to provide...
Fixed:Perl (as well...) tends to provide...
Reported by Laurent Dami, 20-Nov-2002

p40, second paragraph

Printed:The result are now much nicer
Fixed:The result is now much nicer
Reported by Christian Swoboda, 9-Aug-2002

p51, 2nd paragraph above letter to Tom Cruise

Printed:... each substitution to replacements them all, not just one.
Fixed:... each substitution to replace them all, not just one.
Reported by Joe Pond, 3-Oct-2002

p58, line 3

Printed:print "From: Jeffrey Friedl <jfriedl\@regex.info>\n";
Fixed:print "From: jfriedl\@regex.info (Jeffrey Friedl)\n";
This is just to be consistent with the expected results shown on p54.
Reported by Andreas Karrer, 6-Nov-2002

p63, figure The figure needs additional labels for the lookbehind (which currently now incorectly appear to be covered by the lookahead-related labels). Reported by Andreas Karrer, 6-Nov-2002

p66, last sentence of answer box

Printed:They end up incorrectly replacing JEFFS with Jeff's and JEFF's, respectively.
Fixed:They end up incorrectly replacing JEFFS with Jeff's and Jeff'S, respectively.
Reported by Ingram Monk, 9-Sep-2002

p66, 2nd line below mid-page table

Printed:and it compliment ...
Fixed:and it complement ...
Reported by P. J. Labrocca, 5-Oct-2002

p69, Figure 2-7

Printed:Matched while checking lookahead
Result of lookahead
Fixed:Matched while checking lookbehind
Result of lookbehind
Reported by Andreas Karrer, 6-Nov-2002

p69, Table 2-1, 3rd row

Printed:at which a comma is inserted.
Fixed:at which an apostrophe is inserted.
Reported by Andreas Karrer, 6-Nov-2002

p70, second para from the bottom

Printed:...is quote complex, so do to it exactly is...
Fixed:...is quote complex, so to do it exactly is...
Reported by Steve Conover, 12-Aug-2002

p71, 3rd line from the bottom

Printed: A range like .-\w is almost certainly wrong, yielding a fairly random set of letters, numbers, and punctuation that's dependent on the program and the computer's native character encoding.
Fixed: With many flavors, a range like .-\w is almost certainly wrong, yielding a fairly random set of letters, numbers, and punctuation that's dependent on the program and the computer's native character encoding. Perl handles .-\w in a class fine, but being careful with - in a class is a good habit to have.)
Reported by Andreas Karrer, 6-Nov-2002

p73, 2nd para

Printed:Specifically, /x turns whitespace into ... next newline" metacharacter.
Fixed:Specifically, /x turns most whitespace into ... next newline" metacharacter (=> 110).
Reported by Eric Pement, 11-Dec-2002

p74, O'Reilly url near the bottom of the page

Printed:http://www.oreilly.com/catalog/regex2/.
Fixed:http://www.oreilly.com/catalog/regex2/
The period is left over from when the url was inlined into the flow of the text. It turns out that the URL is still valid, but it's not what I intended.
Added by Jeffrey Friedl, 18-Oct-2002

p74, line after O'Reilly url

Printed:Using at the end \b would disallow...
Fixed:Using \b at the end would disallow...
Reported by Joe Pond, 3-Oct-2002

p75, 3rd line

Printed:... include an ending .,?! as part...
Fixed:... include an ending [.,?!] as part...
Reported by Andreas Karrer, 6-Nov-2002

p76, middle of 2nd-to-last paragraph

Printed:or even as subexpression of some other regex
Fixed:or even as a subexpression of some other regex
Reported by Joe Pond, 3-Oct-2002

p76, last paragraph

Printed:...with Java packages an .NET discussed...
Fixed:...with Java packages and .NET discussed...
Reported by Terry Jones, 9-Aug-2002

p79, First sentence of (5)

Printed:...marked all the doubled words, we want keep only logical...
Fixed:...marked all the doubled words, we want to keep only logical...
Reported by Joe Pond, 3-Oct-2002

p80, third paragraph

Printed:Still, the task of showing the concepts is made a bit easier due to a unique feature of Perl among advanced languages that regular expressions are a "first class," low-level feature of the language.
Fixed:Still, the task of showing the concepts is made a bit easier due to a Perl feature unique among advanced languages, which is that regular expressions are a "first class," low-level feature of the language.
Reported by Philip Hazel, 19-Aug-2002

p81, first regex in progam
The first regex should be shown in bold, like the others.
Reported by Andreas Karrer, 6-Nov-2002

p84, last sentence of second paragraph

Printed:...next chapter is devoted to it.
Fixed:...next chapter is devoted to them.
Reported by Philip Hazel, 19-Aug-2002

p87, second line from the bottom

Printed:Thy are not regex-specific concept, ...
Fixed:They are not a regex-specific concept, ...
Reported by Ryan Flynn, 1-Aug-2002 (the first typo reported!)

p88, 4th para

Printed:which could be freely incorporate by others
Fixed:which could be freely incorporated by others
Reported by Jason Holmes, 17-Feb-2003

p89, 2nd-to-last para

Printed:Perl 4 was released half a year later, ...
Fixed:Perl 4 was released a year and a half later, ...
Reported by Hwansoo Suh, 25-Oct-2002

p97, first paragraph

Printed:each was just chosen by the developers who happened to have thought was the best approach at the time
Fixed:each was just chosen by the developers who thought it was the best approach at the time.
Reported by Joe Pond, 3-Oct-2002

p108, end of 3rd para

Printed:(U+0048 U+U007A).
Fixed:(U+0048 U+007A).
Reported by Hwansoo Suh, 28-Oct-2002

p110, mid 2nd para

Printed:... combining sequence (=> 107), U+006A and U+030C.
Fixed:... combining sequence (=> 107), U+004A and U+030C.
Reported by Hwansoo Suh, 28-Oct-2002

p113, toward bottom of 2nd section

Printed:[.span-ll.]]>
Fixed:[.span-ll.]]
Reported by Hwansoo Suh, 29-Oct-2002

p114, 2nd-to-last para

Printed:... some of the control shorthands they...
Fixed:... some of the character shorthands they...
Reported by Laurent Dami, 17-Dec-2002

p118, end of third paragraph
The "this is a regex" little brackets should be removed from around the \x80-\xFF, since it's just part of a class, and not a full-fledged regex unto itself.
Reported by Andreas Karrer, 6-Nov-2002

p121, throughout table
The description for \p{Mn}, \p{Mc}, \p{Nd}, and \p{Nl} should have the leading words begin with an uppercase letter, to be consistent with the rest of the table.
Reported by Jeffrey Friedl, 26-Apr-2003

p121, last entry
I'm not sure where \p{Not_Assigned} came from. Looking at it now, I think it should be \p{Unassigned}.
Reported by someone to O'Reilly, 29-Apr-2003

p123, 2nd-to-last para

Printed:...may seem a bit odd a first...
Fixed:...may seem a bit odd at first...
Reported by Andreas Karrer, 6-Nov-2002

p126, after list
The paragraph after the list is typeset with too little leading.
Reported by Andreas Karrer, 6-Nov-2002

p129, third line

Printed:..."match all" function, The failure that...
Fixed:..."match all" function, the failure that...
Reported by Philip Hazel, 19-Aug-2002

p129, second-to-last line

Printed:bumps along to the next character when it...
Fixed:bumps along to the next character (xref to p148) when it...
This is not really an error, but adding a cross-reference here makes sense.
Reported by Philip Hazel, 19-Aug-2002

p130, last line with a regex

Printed:my ($badstuff) = $html =~ m/\G(.{1,12})/g;
Fixed:my ($badstuff) = $html =~ m/\G(.{1,12})/;
It would also make sense to swap the ``my ($badstuff)'' and ``my $location'' lines, as it would be a bit more clear that way.
Reported by Andreas Karrer, 6-Nov-2002

p135, first para

Printed:turns `C:\WINDOWS\' into `C:\\WINDOWS\\'
Fixed:turns `C:\WINDOWS\' into `C\:\\WINDOWS\\'
This changes makes the statement technially correct, at the cost of slighly muddling the point.
Reported by Andreas Karrer, 6-Nov-2002

p136, Table 3-14

The table should note:
  • GNU Emacs supports, within the replacement string, \& to represent the text of the entire match, and \1, \2, etc. for parenthesized submatches.

  • GNU awk supports & to represent the text of the entire match in replacement strings. Aadditionally, the gensub function supports \0 (as well as &) in the replacement string, along with \1, \2, etc, for parenthesized submatches.

  • For GNU sed (and any sed), the entire match is &, not \& (as was written). And for & and \1, etc., they also work within the regex itself (and not only the replacement sting).
Reported by Eric Pement, 11-Dec-2002

p136, table, 2nd row

The table should note that GNU Emacs supports, within the replacement string, \& to represent the text of the entire match, and \1, \2, etc. for parenthesized submatches.
Reported by Eric Pement, 11-Dec-2002

p137, middle of page

Printed:...is available via \k<Month> with .NET, and (?P=Month) in Python.
Fixed:...is available via \k<Area> with .NET, and (?P=Area) in Python.
Reported by Michael Donn, 8-Oct-2002

p138, second-to-last paragraph

Printed:(The else part my be omitted, ...
Fixed:(The else part may be omitted, ...
Reported by Philip Hazel, 19-Aug-2002

p139, 3rd-last-para

Printed:can used as the if test.
Fixed:can be used as the if test.
Reported by Laurent Dami, 17-Dec-2002

p160, first line

Printed:Let's look a simple example
Fixed:Let's look at a simple example
Reported by Charles Daniels, 29-Jan-2007

p162, last sentence

Printed:..., there are a dozen saved states...
Fixed:..., there are 13 saved states...
Reported by Hojae Lee, 11-Aug-2002

p163, first sentence

Printed:...governed dot matching 12 things that are...
Fixed:...governed dot matching 13 things that are...
Reported by Hojae Lee, 11-Aug-2002

p164, end of 2nd paragraph in sidebar

Printed:...in the regex after the [0-9]*] that kept...
Fixed:...in the regex after the [0-9]* that kept...
Reported by Michael Donn, 8-Oct-2002

p165, last paragraph before heading

Printed:Actually, there's could be...
Fixed:Actually, there could be...
Reported by Justin Shaw, 9-Aug-2002

p169, paragraph above the header

Printed:We know that .* with the greedy...
Fixed:We know that ".*" with the greedy...
Reported by P. J. Labrocca, 11-Oct-2002

p174, third line of last paragraph

Printed:...checked in the right-to-left order given...
Fixed:...checked in the left-to-right order given...
Wow, I (and all the reviewers) must be dyslexic...
Reported by Dana Schwartz, 16-Aug-2002

p183, first line

The 1234.5678.9101112.131415 should be in single quotes, rather than being marked as a regex.
Reported by Andreas Karrer, 3-Feb-2003

p188, first line
The 1234.5678.9101112.131415 should be surrounded by singlequotes rather than the little "this is a regex" markers.
Reported by Jeffrey Friedl, 26-Apr-2003

p191, code snippet

Printed:$WholePath =~ m{ ([^/]*)$ };
Fixed:$WholePath =~ m{([^/]*)$};
I could have also just used the /x modifier, which is probably what I intended to do when I added the spaces in the first place.
Reported by Terry Jones, 13-Aug-2002

p196, last paragraph before the heading

Printed:As I mentioned earlier, the "match anything not the closing delimiter" can become complicated when the closing delimiter is more than one character, or in situations where it can appear within the main text.
Fixed:As I mentioned earlier, satisfying these requirements can become complicated when the closing delimiter has more than one character, or when it may appear within the main text.
Reported by Terry Jones, 13-Aug-2002

p197, mid-page

Printed:"You need a 2\"3\" photo."
Fixed:"You need a 2\"x3\" photo."
The same change is needed in the boxed text one paragraph below, as well.
Reported by Andreas Karrer, 3-Feb-2003

p201, second paragraph

Printed:..., could case a very rude surprise...
Fixed:..., could cause a very rude surprise...
Reported by Brian Zalk, 7-Aug-2002

p205, first line, and both code snippets

In each of the hostname regexes, the final [-a-z0-9] should be [a-z0-9] (the hyphen leading the class shouldn't be there.)
The problem carries over to pp304 and 306 as well
Reported by Ivan Heckman, 11-Sep-2002

p205, both code snippets

Printed:(?:i) # apply this regex in a case-insensitive manner.
Fixed:(?i) # apply this regex in a case-insensitive manner.
Reported by Justin Shaw, 9-Aug-2002

p208, end of code snippet

At the end of the code snippet, there are two long character classes: [^;"'<>()\[\]{}\s\x7F-\xFF]. They are missing four characters, [^!.,?;"'<>()\[\]{}\s\x7F-\xFF].

Also, the short class before the final long one, [.,?]+, is missing an exclamation point: [!.,?]+.

The missing characters are the ``NOT_END'' characters from the comparable Java expression on p209, and are the whole point of that part of the regex (they're allowed to be embedded, but not at the end).

Reported by Ivan Heckman, 11-Sep-2002, with an addendum by Jeffrey Friedl on 18-Oct-2002

p209, mid-program
The ``NOT_END'' class, [.,?]+, is missing an exclamation point: [!.,?]+.
Added by Jeffrey Friedl, 18-Oct-2002

p212 mid-page

Printed:while (m/(\d\d\d\d\d)/) {
Fixed:while (m/(\d\d\d\d\d)/g) {
Reported by Andreas Karrer, 3-Feb-2003

p214, mid-page code snippet

The variable in the while clause of the mid-page code snippet should be $line, as should the reference to it in the preceding paragraph.
In the first printing, I'd had the in-paragraph version something different ($html), and when pointed out that they were inconsistant, changed the in-code one to be $html as well. That was silly, because it's not HTML that's being worked with -- I should have changed the in-paragraph one to $line. Unfortunately, the second printing of the book went out with that wrong change. (I'll blame the fact that my first child was due at any moment while I was entering these changes -- he was born two days later -- and so I may have been a bit distracted (-:).
Reported by Andreas Karrer, 3-Feb-2003

p215, end of 3rd para

Printed: That's why there's one empty match between each valid match (and although not shown, there's an empty match at the end).
Fixed: That's why there's one empty match between each valid match, and one more empty match before each quoted field (and although not shown, there's an empty match at the end).
Reported by Andreas Karrer, 3-Feb-2003

p217, last para

Printed:Unfortunately, as the section in the previous chapter (=> 132) explains
Fixed:Unfortunately, as the section in Chapter 3 (=> 132) explains
Reported by Andreas Karrer, 3-Feb-2003

p223, Figure 6-1
The grayed doublequote in the lower-right quadrant of the figure should not be grayed.
Reported by Andreas Karrer, 3-Feb-2003

p223, last line
The last line ends with a partial word -- a typesetting no-no.
Reported by Jeffrey Friedl, 26-Apr-2003

p226, 2nd para

Printed:This is a big savings.
Fixed:This is big savings.
Reported by John Popplewell, 17-Feb-2003

p228, first paragraph

Printed:.... the relative performance of a regex like can tell you about...
Fixed:.... the relative performance of a regex like this can tell you about...
Reported by Terry Jones, 15-Aug-2002

p232, 2nd-to-last bullet

Printed:...or other setup that must done, do it before...
Fixed:...or other setup that must be done, do it before...
Reported by Joe Pond, 3-Oct-2002

p233, code snippet

Printed:while (--$Count > 0) {
Fixed:while ($Count-- > 0) {
This change happens twice in the snippet. The difference is that before the change, the loop stops one iteration too soon. Oops!
Reported by Terry Jones, 15-Aug-2002

p233, last paragraph

Printed:So, with this test case, one is about 11× faster than the other.
Fixed:So, with this test case, one is about 22× faster than the other.
One one or two two -- I guess typing is not my strong point! Or maybe it's just basic math that I can't do. Sorry!
Reported by Ryan Flynn, 6-Aug-2002

p234

Printed:Now, the test string is 1,000 times shorter,
Fixed:Now, the test string is 1,000× shorter,
It just reads better this way.
Reported by Terry Jones, 15-Aug-2002

p238, Ruby example

Printed:takes .3f seconds
Fixed:takes %.3f seconds
This mistake appears on each of the two print statements in the example.
Reported by Andreas Karrer, 3-Feb-2003

p240, Tcl example

Printed:takes .3f seconds
Fixed:takes %.3f seconds
This mistake appears on each of the two puts statements in the example.
Reported by Andreas Karrer, 3-Feb-2003

p240, footnote

Printed:For example, I might insert in at the marked...
Fixed:For example, I might insert it at the marked...
Reported by Dana Schwartz, 16-Aug-2002

p244, last line

Printed:(which is fast way to search...
Fixed:(which is a fast way to search...
Reported by Brian Zalk, 8-Aug-2002

p246, fourth line

Printed:Similar optimizations involves \A, ...
Fixed:Similar optimizations involve \A, ...
Reported by Dana Schwartz, 16-Aug-2002

p247, 2nd-to-last para

Printed:Uses of start, plus, and friends...
Fixed:Uses of star, plus, and friends...
Reported by Karl D'Adamo, 21-Oct-2002

p250, first heading

Printed:Exponential (a.k.a, super-liner) short-circuiting
Fixed:Exponential (a.k.a, super-linear) short-circuiting
Reported by Brian Zalk, 8-Aug-2002

p251, sidebar, end of first paragraph

Printed:... or possessive quantifiers, ^\w++>:
Fixed:... or possessive quantifiers, ^\w++:
Reported by Terry Jones, 15-Aug-2002

p256, 1st para

In ``^abc|^123 and ^(?:abc|123) are logically the same expression,'', the two expressions should be swapped. This allows later references like ``the first'' and ``the second'' to refer to the proper expressions. It's the one with ^(?:...|...), with the exposed ^, that can be more efficient with many tools. Considering that the order these are presented affects the whole point of the paragraph, this was a pretty big boo-boo. Sorry.
Reported by Luis Galup, 31-Oct-2002

p257, second-to-last line

Printed:.., the negative lookahead (underlined for clarity)...
Fixed:.., the positive lookbehind (underlined for clarity)...
I must have been dyslexic when I wrote that...
Reported by Terry Jones, 15-Aug-2002

p258, start of second-to-last paragraph

Printed:If the initial-character discrimination optimization its not done...
Fixed:If the initial-character discrimination optimization is not done...
Reported by Dami Laurent, 3-Mar-2003

p258, end of second-to-last paragraph

Printed:(Tcl, of course, can...
Fixed:(PCRE can do it if the optional pcre_study function is called, and Tcl, of course, can...
Not exactly an error, but a clarification from the author of PCRE himself....
Reported by Philip Hazel, 19-Aug-2002

p278, second line

Printed:beginning, any point you that the text is:
Fixed:beginning, any point in the text that you start at is:
Reported by Terry Jones, 17-Aug-2002

p278, toward the bottom

Printed:to removeC++ /Java/C# style:
Fixed:to remove C++/Java/C# style:
Reported by Terry Jones, 17-Aug-2002

p280, mid-page

Printed:match: 1> at the very start...
Fixed:match: 1) at the very start...
Reported by Philip Hazel, 19-Aug-2002

p285, mid-left of the table

Printed:use charnames 'full';
Fixed:use charnames ':full';
Reported by H. Merijn Brand, 9-Aug-2002

p288, second paragraph of 5th bullet

Printed:\p{UNASSIGNED
Fixed:\p{UNASSIGNED}
Actually, with the Perl finally released as 5.8 (as opposed to the beta releases), the capitalization doesn't matter, so you can use \p{Unassigned} as well, which looks nicer.
Reported by H. Merijn Brand, 9-Aug-2002

p288, first line after heading

Printed:The final items in Table 7-1 are marked ...
Fixed:The final items in Table 7-2 are marked ...
Reported by Dana Schwartz, 16-Aug-2002

p290, first para of last bullet

Printed:...such as in \F or \&.
Fixed:...such as in \F or \H.
Added by Jeffrey Friedl, 11-Feb-2003

p292, first line

Printed:... is parsed like to a "regex-aware"
Fixed:... is parsed like a "regex-aware"
Reported by Terry Jones, 18-Aug-2002

p292, last para

Printed:Perl's regex operands allow regex modifiers ... core modifiers that all regex operands support, ...
Fixed:Perl's regex operators allow regex modifiers ... core modifiers that all regex operators support, ...
Reported by Dami Laurent, 3-Mar-2003

p302, para about $^R

Printed:... constructs (=> 327), and has no value outside of a regex. It is the...
Fixed:... constructs (=> 327). It is the...
After a successful match, $^R holds the value of the last-executed embedded-code or dynamic-regex constructs that actually participated in the successful match. It must have not during some of the beta releases of 5.8, for I can't otherwise guess how I could have thought it didn't have a value. In the released version, it clearly does have a value.
Reported by Andreas Karrer, 3-Feb-2003

p303, third line below mid-page heading

Printed:... substitution, or spilt, or ...
Fixed:... substitution, or split, or ...
Reported by H. Merijn Brand, 18-Aug-2002

p304, mid-page code snippet
In the hostname regex, the final [-a-z0-9] should be [a-z0-9] (the hyphen leading the class shouldn't be there.)
The problem carries over from p205, and to p306 as well
Reported by Ivan Heckman, 11-Sep-2002

p304, last paragraph
The two occurrences of $WordObject should be $WordRegex.
Reported by Joe Pond, 3-Oct-2002

p305, last code snippet

Printed:(?ix-sm:\b \w+ \b)
Fixed:(?x-ism:\b \w+ \b)
Reported by Andreas Karrer, 3-Feb-2003

p306, code snippet
In the hostname regex, the final [-a-z0-9] should be [a-z0-9] (the hyphen leading the class shouldn't be there.) The problem carries over from pp205 and 304
Reported by Ivan Heckman, 11-Sep-2002

p308, last code snippet

Printed:# Copy $text to $result...
Fixed:# Copy $text to $copy...
Reported by Terry Jones, 19-Aug-2002

p311, first large paragraph

Printed:... in the scalar context provided by the while conditional, ...
Fixed:... in the scalar context provided by the if conditional, ...
I have no idea what I was thinking to write "while"...
Reported by Terry Jones, 20-Aug-2002

p311, 2nd-to-last code snippet

Printed:my @nums = $text =~ m/\d+(?:.\d+)?|\.\d+/g;
Fixed:my @nums = $text =~ m/\d+(?:\.\d+)?|\.\d+/g;
Reported by Andreas Karrer, 3-Feb-2003

p320, 2nd-to-last para

Printed:Normally, the replacement operator is evaluated...
Fixed:Normally, the replacement operand is evaluated...
Reported by Dami Laurent, 3-Mar-2003

p321, 9 lines from the bottom

Reported by N. R., 23-Feb-2003

p325, end of top paragraph

Printed:...on a single character, but it you can split...
Fixed:...on a single character, but you can split...
Printed:("a", "", "simple", "", "test")
Fixed:("a", " ", "simple", " ", "test")
Reported by Philip Hazel, 19-Aug-2002

p325, first bullet point

Printed:("s", "h", "o", &bigmidddot, "s", "t")
Fixed:("s", "h", "o", · · ·, "s", "t")
Oops, that my markup leaking through!
Reported by Philip Hazel, 19-Aug-2002

p325, second bullet point

Printed:It's almost the same as \s+, except that leading whitespace is skipped.Trailing whitespace is ignored as well if an appropriately large (or negative) chunk-limit operand is given.
Fixed:It's almost the same as \s+, except that leading whitespace is skipped.
Reported by Andreas Karrer, 3-Feb-2003

p326, code snippets
In the first element of the array (in each code snippet), the space after and should be shown with the light gray "visual space" dot.
Reported by Andreas Karrer, 3-Feb-2003

p326, footnote

Printed:if split is used in a scalar context,
Fixed:if split is used in a scalar or void context,
The rest of the footnote is updated accordingly, as well.
Reported by Andreas Karrer, 3-Feb-2003

p327, first line of third paragraph

Printed:This simple example ^(\d)(??{ "X{$1}" })$ is shown...
Fixed:This simple example ^(\d+)(??{ "X{$1}" })$ is shown...
Reported by H Merijn Brand, 9-Sep-2002

p329, figure caption
The caption is wrong -- it should be "Matching a few levels of parentheses"
Reported by Dami Laurent, 3-Mar-2003

p331, prose line after first code block

Printed:...of $LevelN in action on page 343;
Fixed:...of $LevelN in action on page 343.
Reported by Dami Laurent, 3-Mar-2003

p335, first line

Printed:Here's a simple example that uses finds ...
Fixed:Here's a simple example that finds ...
Reported by Dana Schwartz, 16-Aug-2002

p337, second-to-last paragraph of sidebar

Printed:The \s+ is needed because...
Fixed:The \s* is needed because...
Reported by Philip Hazel, 19-Aug-2002

p339, 2nd-to-last paragrahp

Printed:...Programming Perl and Object Oriented Perl show discuss why...
Fixed:...Programming Perl and Object Oriented Perl discuss why...
Reported by Joe Pond, 3-Oct-2002

p341, fifth line

Printed:Adding these items to skeleton expression gives us:
Fixed:Adding these items to the skeleton expression gives us:
Reported by Dana Schwartz, 16-Aug-2002

p344, 3rd line

Printed:in the sidebar on page => 130).
Fixed:in the sidebar on page 130).
Reported by Andreas Karrer, 3-Feb-2003

p344, 2nd para

Printed:m/($MyStuff)*+//
Fixed:m/($MyStuff)*+/
Reported by Andreas Karrer, 3-Feb-2003

p351, first line

Printed:Not all regex operands can be cached. Consider this snippet:
Fixed:Not all regex operands can be cached directly. Consider this snippet:
Reported by Peter Scott, 16-Oct-2002

p356, last para

Printed:... rather than the 50,000 or so reasonbly sized lines.
Fixed:... rather than the 130,000 or so reasonbly sized lines.
I'd updated the data about the test from the first edition, but neglected to update this reference. You can see how much Perl's source has grown in the last five years.
Reported by Andreas Karrer, 3-Feb-2003

p356, last line

Printed:you to tweak your code for better efficiently.
Fixed:you to tweak your code for better efficiency.
Reported by Joe Pond, 3-Oct-2002

p358, first para

Printed:The easiest is perhaps to use...
Fixed:The easiest, if your perl binary has been compiled with the -DDEBUGGING option, is to use...
Reported by Andreas Karrer, 3-Feb-2003

p359, mid-page

Printed:...is found. On most systems, ...
Fixed:...is found. (On most systems, ...
Reported by Philip Hazel, 19-Aug-2002

p361, 3rd para

Printed:... turn it back off with no re 'debug';, but it turns of automatically at the end of the block or file in which the use is placed.
Fixed:... turn it back off with no re 'debug';.
Unlink other pragmas, use re 'debug' is not lexically scoped, a fact that seemed to have slipped by me.
Reported by Andreas Karrer, 3-Feb-2003

p362, 2nd-to-last para

Printed:Line (8) is not related to any particular regex. After loading...
Fixed:Line (8) is not related to any particular regex, and is shown only if your perl binary has been compiled with the -DDEBUGGING option. If support has been compiled in, after loading...
Reported by Andreas Karrer, 3-Feb-2003

p364, third paragraph

Printed:Finally, I as I mentioned...
Fixed:Finally, as I mentioned...
Reported by Oran Dennison, 1-Aug-2002

p364, fourth paragraph

Printed:..., but it very close, ...
Fixed:..., but it is very close, ...
Reported by Oran Dennison, 1-Aug-2002

p370, figure

Printed:"Mar 16, 1998"
Fixed:"May 16, 1998"
Reported by Jeffrey Friedl, 26-Apr-2003

p373, 2nd-to-last row

Small typographical issue: the three "partial" should just be hollow checkmarks. I'm not sure why I didn't use them originally.
Reported by 26-Sep-2002

p375, last line of code snippet

Printed:.findNext(); (3) , (5)
Fixed:.findNext(); // (3) , (5)
Reported by Andreas Karrer, 3-Feb-2003

p379, last heading in the table

Printed:Grouping, Capturing, Conditional, and Control
Fixed:Grouping and Capturing
There's no need to include "Conditional" or "Control" in the heading, since Java has none.
Reported by Andreas Karrer, 3-Feb-2003

p379, last entry the table

Printed:...{n,}+ {x,y}?
Fixed:...{n,}+ {x,y}+
Reported by Dami Laurent, 21-Mar-2003

p382, 3rd and 4th line of last table

Printed:^ matches at the beginning of line only
$ and \Z match before line-ending:
Fixed:^ matches at the beginning of string only
$ and \Z match before string-ending:
It's more clear this way.
Reported by Andreas Karrer, 3-Feb-2003

p385, first para
Remove the comment about String's matches(). This is an error on top of an error: I'd intended it to refer to String's lookingAt() method, but goofed. But it turns out that in 1.4, there is no String.lookingAt method. Perhaps it was there in a beta, or maybe I just started seeing things.....
Reported by Andreas Karrer, 3-Feb-2003

p386, bottom code snippet
The variable first would be better named second.
Reported by Andreas Karrer, 3-Feb-2003

p389, prose before and after last code snippet
References in the text to the Metric variable should be to the metric variable, to match the code.
Reported by Dami Laurent, 21-Mar-2003

p394, just above second "substitute" header

Printed:s/\\b([A-Z])([A-Z]+)/...
Fixed:s/\\b([A-Z])([A-Z]+)\\b/...
Also, the Perl example on the following line should have \b added to the end of its regex. These changes stop text like ``HALFway'' from being modified, which keeps it consistant with the example's description (targeting words in all caps).
Reported by Andreas Karrer, 3-Feb-2003

p398, bottom code snippet
The variable first would be better named second.
Reported by Andreas Karrer, 3-Feb-2003

p400, end of 2st para

Printed:...most of which is discussed in %Chapter<3>,
Fixed:...most of which is discussed in %Chapter<3>.
Reported by Laurent Dami, 6-Apr-2003

p402, 3rd para

Printed:The RegexOptions.ExplictCapture option (also available via...
Fixed:The RegexOptions.ExplicitCapture option (also available via...
Reported by Laurent Dami, 6-Apr-2003

p406, first header

Printed:Backlash-digit ambiguities
Fixed:Backslash-digit ambiguities
Reported by Oran Dennison, 1-Aug-2002

p407, fifth paragraph

Printed:The following examples all which work with...
Fixed:The following examples all work with...
Reported by Oran Dennison, 1-Aug-2002

p408, mid-page snippets
Four occurances of "Subject" within a quoted string are italicized. They shouldn't be. (That's my automated book-building tools being a bit overzealous).
Reported by Andreas Karrer, 3-Feb-2003

p410, last line of "Core Object Overview" para

Printed:... to the string 'Mar 16, 1998'
Fixed:... to the string 'May 16, 1998'
Reported by Andreas Karrer, 3-Feb-2003

p411, figure
These changes should be made to the labels in the figure:

I'd really love to know how I let these get by (grumble)
Reported by Andreas Karrer, 3-Feb-2003

p416, last para

Printed:...dispense with the MatchCollection variable altogether
Fixed:...dispense with the MatchCollection object altogether
It seems a bit more clear this way
Reported by Laurent Dami, 6-Apr-2003

p417, ".Replace" example

Printed:Text = R_CapWord.Replace(Text, "<B>$1</B>")
Fixed:Text = R_CapWord.Replace(Text, "<B>$0</B>")
Required because the regex has no capturing parenthses
Reported by Brian Cerny, 7-Jun-2003

p422, result output

Printed:(Is Right-To-Left: False)   (twice)
Fixed:Is Right-To-Left: False
Reported by Andreas Karrer, 3-Feb-2003

p424, 2nd to last para

Printed:..where in the target text the match was found.
Fixed:..where in the target text the group match was found.
Reported by Laurent Dami, 6-Apr-2003

p427, 2nd para

Printed:Given a string, Match.Escape(...) returns...
Fixed:Given a string, Regex.Escape(...) returns...
Reported by Andreas Karrer, 3-Feb-2003

p431, 1st para

Printed:...which is normal negative lookbehind of an empty...
Fixed:...which is normal negative lookahead of an empty...
Reported by Masaru Tawa, 22-Mar-2003

p432, 3rd bullet
The two references to Group(0) should be Groups(0).
Reported by Hwansoo Suh, 18-Jan-2007

p432, 3rd bullet

Printed:gives direct access to the Capture property of
Fixed:gives direct access to the Captures property of
Reported by Laurent Dami, 6-Apr-2003