Come to think of it, Damian mentioned early in that very presentation that he had recently enjoyed catching Jeffrey Friedl--regex guru nonpareil--in a regex error.
Actually, it was the younger regex Jedi, our very own japhy, whom I caught out.
As every teacher learns, nothing quite motivates a roomful of students to cleverness like the thrill of catching the teacher in a mistake.
So true. In fact, it was precisely by manipulating that basic human desire (i.e. to see the mighty stumble ;-) that I caught out someone as highly clueful as japhy. I deliberately made it look like I'd made a mistake, when in fact I was demonstrating an inconsistency in a rarely-used behaviour.

Specifically, I showed some code equivalent to the following:

$var =~ s?pattern?string?;
and asked what was unusual about the substitution.

Most regex adepts will reply:

The use of ? as the delimiter causes the regex to match at most once between calls to reset (as described in the perlop manpage).

But the real answer is:

The use of ? as the delimiter doesn't cause the regex to match at most once between calls to reset. That behaviour only applies to matches, not substitutions.
I have to confess that I much prefer this proxied variation on chip's "humble the guru" motivational technique, rather than the version in which the presenter himself is the one who gets humbled! ;-)

In reply to Re: Re (chip): Re5: Technical Interview by TheDamian
in thread Technical Interview by jonjacobmoon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.