Regex & Facebook Experience Tech Talk

I recently gave a talk for a group of university students studying web development in Belgrade, Serbia. In it, I talked about my background, my experience starting in tech and eventually working at Facebook for seven years, and (most relevant to this blog) I spent about 20 minutes showing off some cool and advanced regular expressions. Specifically, regexes for switching Fahrenheit to Celsius, deleting repeated words, deleting non-adjacent duplicate lines, checking password complexity, reformatting names, adding thousands separators, matching balanced parentheses, and matching palindromes.

You can find the video and slides here (Lecture at SAE Belgrade: Lessons from Facebook) or you can watch the video on YouTube (with the regex portion starting at 52:26).

New Blog ‘Lifecurious’ at

Flagrant Badassery has been pretty quiet for years now, but it's still my home for all things JavaScript and regular expression related. That said, I've just launched a shiny new blog where I'm posting about everything unrelated to programming.

Want to learn about aphantasia and hyperphantasia, the time I unmasked cult leader Karen Zerby, why South Dakota residency is an ideal choice for nomads, or discover the best English teaching books?

All of these and more await at Lifecurious.

Lifecurious screenshot

Still Alive

Well, I'm back. I didn't mean to go silent for so long, but I've been busy. Although it will be a few months before it comes out, Jan Goyvaerts and I have mostly finished work on our new regex book — stay tuned for more info. During this blogging hiatus I've also attended multiple family reunions, switched jobs, learned a new language (ActionScript 3), put in crazy hours on a new website launch, and about five weeks ago I moved to sunny Baghdad, Iraq for webdev work.

Anyway, now that work is calming down just enough for some breathing room, I should be able to get back to this blogging thing a little more regularly.

Teaser: Relatively soon I hope to release a new version of XRegExp, which will provide a way to easily extend XRegExp with your own, new regex features.

Writing a Regex Book

I'm excited to announce that I've recently started working on a regular expression book for O'Reilly Media. The back story is that a few months ago, Jeffrey Friedl (author of the world's best regular expression book yet wink) was kind enough to introduce me to his editor at O'Reilly, Andy Oram. After Andy and I discussed what we thought was a good follow-up and alternative approach to Jeffery's very popular book, I asked Jan Goyvaerts (of RegexBuddy and if he was interested in working together. Long story short, Jan and I are now working on what we hope will be an exceptionally practical, high-quality guide to solving real problems using regular expressions. You can see Jan's announcement on his blog.

Unfortunately, due to work on the book and other responsibilities I probably won't be able to spend as much time on this blog until the book is further along. However, as things progress I hope to share more information about the project, and get some early feedback on a few sections. Let me know if there are particular regex problems you'd like to see solutions for in the book.

Update: The book is now available for pre-order: Regular Expressions Cookbook.

Highlights From SXSWi 2008

I'm back from the SXSW Interactive conference, which offered a pretty decent selection of panels and good times. I ended up attending about 20 panels over three and a half days, and about as many bars and after-parties. Here were some of the personal highlights, for anyone who's interested.

The first session I attended on Saturday morning was High Performance Web Sites (panel info) by Steve Souders. I've read Steve's book, so there wasn't really anything new there for me. For those out of the loop, there's a summary of the rules in his book on the Yahoo! Developer Network. Apart from his YSlow add-on for Firebug, he also mentioned HttpWatch ($295) for IE, which seemed pretty cool. What was more interesting for me though was meeting Steve the next day at the O'Reilly Media booth, where we discussed the success of his book (which I believe was the best selling tech book on Amazon last year), working with O'Reilly Media and specifically his editor Andy Oram (who also edited Mastering Regular Expressions, among other top-selling O'Reilly books), and the upcoming Velocity conference that Steve will co-chair. At one point I asked him why he moved from Yahoo! to Google. His response was that he'll be able to focus more on open source and green computing, which are issues he's passionate about. The probable pay raise and that fact that he now knows about pretty much everything that both Yahoo! and Google are doing for web performance can't hurt either. I also learned that he's working on a sequel to his book (as opposed to a second edition), which will include a range of additional front-end performance tips and insight.

Another early Saturday panel I attended was Accessible Rich Media (panel info, podcast). Developing rich yet accessible internet applications seemed to be one of the focuses for SXSWi this year, but the main reason I'm mentioning this panel here is to point out some of the tools they highlighted: NVDA (an open source, Windows screen reader), Colour Contrast Analyser, the iCITA Firefox Accessibility Extension, and Fangs (a screen reader emulator). They also talked up WAI-ARIA and the accessibility built into Dojo's Dijit control library.

From there it was on to 10 Things We've Learned at 37signals (panel info, podcast), which as I've mentioned previously was one of the highlights for me. Co-founder Jason Fried covered some of the overarching principals at 37signals, including ways they try to improve productivity within their team, as well as the usefulness and simplicity of their software.

Following are the main points he discussed, as described on the accompanying slides. Listen to the podcast for more details.

  1. Ignore the great unknown
  2. Watch out for red flags (by this he meant words such as need, can't, only, fast, and easy, which often lead to project delays)
  3. Be successful and make money by helping other people be successful and make money
  4. Target nonconsumers and nonconsumption
  5. Question your work regularly
  6. Read your product
  7. Err on the side of simple
  8. Invest in what doesn't change
  9. Follow the chefs (this was about becoming famous and successful by giving away your knowledge)
  10. Interruption is the enemy of productivity
  11. Road maps send you in the wrong direction
  12. Be clear in crisis
  13. Make tiny decisions
  14. Make it matter

It turns out they've learned a few more than 10 things.

Skipping right along to the Keynote Interview with Mark Zuckerberg (panel info, podcast, video)… um, yeah, it was salvaged only by the crowd's reaction, which has been much written about. Many people seem to agree that the interviewer was fairly self-centered and didn't understand her audience.

The only discussion that might have gotten more laughs than the Zuckerberg interview was LOLWUT? Why Do I Keep Coming Back to This Website? (panel info), which chronicled I Can Has Cheezburger? from its inception to its massive success, subsequent buyout, and further expansion. It turns out that lolcats pay the salaries of nine people these days, including four developers. Another important thing I learned was that there's a loldog site at I Has a Hotdog. The folks behind those sites are also working on a new political photos site, which they introduced with an awesome image of Hillary Clinton shouting "THIS IS … SPARTA!"

Side note: One cool thing at the convention center was the number of Rock Band and Guitar Hero 3 sets available. If you include the Interactive trade show, ScreenBurn arcade, and a secondary Microsoft booth in one of the hallways, there were at least five Guitar Hero 3 setups plus four more Rock Band sets. At one point, Guitar Hero world champion Freddie Wong was showing off at the main Microsoft booth, where he racked up an over 100-note streak playing at expert difficulty with the guitar behind his head. After pretending to play some rock music myself, I ended up talking to a number of folks at the Microsoft booth. The big things they were pushing were Silverlight, Deep Zoom, Live Search (especially for multimedia), Live Maps, and Expression Web. They also had a setup where one of the Microsoft people was demoing Project Maestro, a Minority Report -style system where a pair of wireless gloves were being used as the input to move, stack, rotate, and zoom in and out of photos using simple hand gestures. Pretty slick, but it would've been cooler if they'd let you try it out for yourself. Oh, and the Sun booth was giving away free blu-ray movies.

L-R: Chris Wilson, Arun Ranganathan, Charles McCathieNevile, and Brendan Eich

Then there was Browser Wars: Deja Vu All Over Again? (panel info) with Brendan Eich, Mozilla CTO and inventor of JavaScript; Chris Wilson, Internet Explorer Platform Architect and chair of the HTML Working Group; and some dude, from Opera. Just kidding, Charles McCathieNevile is Opera's Chief Standards Officer and an all-around web standards titan.

Joined by moderator Arun Ranganathan (previously of Netscape), the three browser representatives fielded questions on the mobile web (a particularly big deal for Opera), Silverlight, ECMAScript 4, SVG, etc. A podcast of the session should eventually be available from, and will probably be worth checking out. The discussion was attended by a full-capacity crowd, with many who didn't get a seat early being turned away at the door. My friend and coworker Ryan Christie was one of the people turned away, but that worked out because outside the doors he struck up a conversation with fellow shut-out John Resig, who mentioned that Mozilla was hosting a mini-party at a nearby grill later that afternoon.

I didn't want to miss the Mozilla get-together, so Ryan and I headed over shortly afterwards. It was a lot of fun hanging out with the Mozilla people—Brendan Eich, John Resig, Aza Raskin, Melissa Shapiro (who was exceptionally friendly and outgoing, btw)—and all the other people who stopped by. The only downside was that because they had a full bar serving free drinks, I probably downed a few too many.

John Resig (right) and I at Moonshine Grill

Along with free food and drinks, there was plenty of schwag to go around including Mozilla Labs t-shirts, stickers from Mozilla Japan, badges, fake tattoos, and of course screaming monkeys that could be launched slingshot-style across the room. I proceeded to do just that as much as possible. The Mozilla crew also had a competition going for the best Firefox add-on idea, which would net three winners a set of the coolest gear on hand: a nifty Firefox-branded backpack, stuffed animal Firefox, and Mozilla beanie. I submitted some of the worst ideas I could think of (e.g., an email and phone number harvester that would automatically sell the data it gathers as you browse the web to Russian spammers), but the rest of the ideas must have been pretty silly too because I ended up winning first place for a Firefox 3 add-on which would leak memory to remind you of the old days. The idea was actually a collaboration with Ryan, so he took first dibs on the winnings (making off with the stuffed animal). Runner-up winner was a token useful add-on that would show you phishing websites and the sites they were spoofing side by side, I guess as an educational experience. Third place winner was I SERVED U AN AD BUT I EATED IT, which would replace all ads with lolcats.

After the prize handouts, Brendan Eich came by and encouraged me to submit an ES4 ticket on the regex behavior for backreferences to non-participating groups which I've previously mentioned here and on the ES4-discuss mailing list. I think it's something he'd like to see change as well. He also mentioned something about the /x (extended) and /y (sticky) modifiers being among the best ES4 regex extensions, which I wholeheartedly agree with (ES4's /y is similar to but better designed than Perl/PCRE/.NET/Java/Ruby's \G token). Of course, Brendan is someone I deeply respect and admire, so just the fact that he remembered me from the mailing list was pretty cool.

One panel I missed that I would've loved to attend was Secrets of JavaScript Libraries (panel info, slides) hosted by John Resig (jQuery) along with Alex Russell (Dojo), Sam Stephenson (Prototype), Andrew Dupont (Prototype), and Thomas Fuchs (Scriptaculous). Unfortunately, my Tuesday flight left a little too early, but I'll be looking out for the podcast.

So those were most of the highlights for me. Here be a few final observations:

  • Core Conversations is a bullshit format. Seriously, get some mics next time.
  • The porn industry is well represented at SXSWi.
  • Austin seems to be comprised of little more than office space, hotels, and bars.
  • 80% of the world's MacBook Pros and iPhones showed up for the conference.

(Photos by Ryan Christie and his POS Motorola RIZR.)