The "?" is used to limit the * quantifier to match the
smallest possible number of characters before an end of row
("</tr>") tag. By default the * would match
the largest possible number of characters and thus gobble up
all the rows in one bite.

Zero width assertions work like the λ transitions of
a finite state machine. First, punctuate the string "Davids
notes" with an apostrophe using the regular subsitution
operators that "consume" the entire sub-string and replace
it.

s/\bDavids\b/David's/g

Then with the look-around operators that just mark a place
and do not consume input text

s/(?=s\b)(?<=\bDavid)/'/g

The order of the look-arounds does not matter. We can look
behind before or after looking ahead. What matters is that
they resolve to the same place. In "Hats by Davidson" both
look-arounds match but at different places.

To punctuate an arbitrary decimal integer,
like 1,000,000. In Perl

# testregex.pl
while (<>) {
s/(?<=\d)(?=(\d\d\d)+$)/,/g;
print;
}

In Ruby we cannot use the look-behind operator we used in
Perl. What if we could not use the look-ahead operator
either? Would the following work? Why not?

Dialects of Lisp, like eLisp in Emacs and like Clojure, have
good regular expression support. However the literals for
regular expressions are made with ordinary double quoted
strings. So you often need kludges like "\\\\"
to mean match 1 actual backslash. In eLisp parenthses are
used so much that escaping is needed to match an actual
parenthesis -- thus "\\(" to match 1 left parenthesis.