Errata

Regular Expression Pocket Reference

Errata for Regular Expression Pocket Reference, Second Edition

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 7
Table 1

The entries in Class column should all be lower case.

Kevin Day  Nov 14, 2012 
ePub Page 11,46
anchors

page 11: Anchors and zero-width assertions (all languages mentioned in book)

"When supported, \Z matches the end of string or before
a string-ending newline, regardless of match mode."
-------------------------------------------------------------------------------------------------------
pg 46, table 1-23 (Python)

Sequence : Meaning
\Z : End of string or before a string-ending newline, in any match mode

=============================================================
The following program, run by python 3.65, shows that \Z (unlike $)
does not match "before a string-ending newline"

import re

if re.search(r'foo$', 'foo\n'): print("foo\\n matched with $")
if re.search(r'foo\Z', 'foo\n'): print("foo\\n matched with \Z")

Gregory Sherman  Aug 31, 2018 
Printed, PDF Page 14
Numbers from 0 to 999999

The expression does not match the top string, instead it matched the one below.

Adam Zaremba  Apr 16, 2013 
Printed Page 16
top entry

the HTTP URL:
/(https?):\/\/([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})(:\d{1,4})?([-\w\/#~:.?+=&%@~]*)/

returns this error: Unbalanced parenthesis

dfolland  Aug 10, 2009 
Printed Page 23
Table 9

I would like to mention the below printing mistakes on page 23 (Table 9).

$' - It should return 'Text after match' (' single quote)
$` - It should return 'Text before match' (` back tick)

Anonymous  Mar 26, 2012 
Printed, PDF Page 27
[^...]

Under the "meaning" for this class it shows:

"A single character not liste and not contained in a listed range."

Note that it is written as "liste" instead of "listed"

jason.barnett71@gmail.com  Jun 19, 2011 
PDF Page 39
table 17

\W Nonword character, the Unicode property is the positive \p{Xx) not the negative \P{Xx}

Anonymous  Sep 05, 2012 
Printed Page 68
top of page

The dot will match newline IF the m modifier is used, not the s modifier. In Ruby, it is by default multiline as in other language -- that is, the ^ and $ will match the newline characters in Ruby by default.

In most other languages, the s modifier makes the dot match a newline character. In Ruby, it is the m modifier.


Kin Lum  Nov 16, 2012 
Printed Page 77
supported metacharacters

\t is not a vertical tab..\v is

Peter Lindblom  Sep 11, 2011 
Printed Page 79
inside the sequence-meaning table

"{n}? match at least n times, as few times as possible."
has an error. It has to be {n,}? (with the comma inside the curly brackets).

Anonymous  Aug 09, 2014