Dirty Secrets of the Perl Regex Engine

Length: 60 minutes

Prerequisites: None

Description

Skip the blather and just view the slides

Talk Title

I wanted to call the talk Dirty Secrets of the Perl Regex Engine. Unfortunately, I already had a talk that purported to reveal secrets: Stolen Secrets of the Wizards of the Ivory Tower. I was afraid that someone might put this together with Tricks of the Wizards and start to suspect that I am not very clever at thinking of talk titles, so I deviously changed the title of the regex talk to Dirty Stories about the Perl Regex Engine. I still like the other title better, and it appears that I can't make up my mind what it is called.

Barf Bags?

When I say that barf bags are provided, by God, I will provide them. Here's photographic evidence:

I brought two hundred of these, and handed them out as the talk started, just in case. The legends on the bags varied:


Regex Engine Input

Deposit Bytecode Here

Regurgitated Expressions

I wanted to change this to say "Regurgular Expressions", but I didn't have time before the conference.

Parse My Shorts

/^(?{local$d=0})(?:\((?{$d++})|\)(?{$d--})(?(?{$d<0})(?!))|(?>[^()]*))*(?(?{$d!=0})(?!))$/

This obviously matches exactly those strings in which the parentheses are balanced.

Henry Spencer Died For Your Sins

Henry Spencer is the original author of the Perl regex engine. According to Programming Perl:

[Larry] borrowed Henry Spencer's beautiful regular expression package and butchered it into something Henry would prefer not to think about during dinner.

(First edition, page 382.)

Good Luck japhy

Jeff Pinyan had recently signed a contract with Manning Publications to publish a book on regexes. You may interpret this remark either as a genuine expression of good will or as a sarcastic comment on Jeff's chances of emerging alive.

For Parsing HTML

Match this!

It's Ilya's Fault

Ilya Zakharevich, who added most of the new features and optimizations to the Perl regex engine up to about 5.005_03. I had planned to change this to say WWID ("What Would Ilya Do?") for TPC, but didn't have time.

regcomp.c:2599: Internal urp

This is explained in one of the first few slides of the talk.


Several people have asked where I got the bags. I bought the bags themselves for $20/100 from John C. Paul, an industrial paper-goods dealer in Philadelphia. Then I had self-adhesive stickers made up at a photocopy place and stuck the stickers on the bags. At TPC, Brad Murray and I applied the stickers the night before the talk; for YAPC, I got the New York and Philadelphia Perl Mongers to assemble them on the train to Montreal. Thanks, folks.

The guys at John C. Paul were puzzled about what I wanted the bags for. When I bought the second batch, they asked me to explain again. They pondered my explanation for a while, and then one of them said, "Oh, it's a gimmick." Right you are!

I have some extra bags I would like to get rid of. Send me a $2 to cover postage and I will mail you as many as I can fit in a 9x12 envelope. You may also send a SASE, but note that the bags are too large to fit in a standard letter-size (9x4) envelope. I will try to comply with your requests for specific legends. Sorry, the U.S. Postal Service will only allow me to ship unused bags.


Outline



Return to: Universe of Discourse main page | Perl Paraphernalia | Other Classes and Talks

mjd-perl-yak+@plover.com