Flagrant Badassery

A JavaScript and regular expression centric blog

Win a Free Copy of Regex Cookbook 2nd Edition

Update: This contest is now finished. See the list of winners.

I'm excited to announce the release of Regular Expressions Cookbook 2nd Edition, which I wrote together with regex superguru Jan Goyvaerts. It has actually been available as an ebook for a couple weeks on oreilly.com, but as of now, it is also in stock on amazon.com.

To promote this release, O'Reilly Media is giving away free copies to 15 people who comment on this post on or before September 7th! To get a free copy, you must read the details at the end of this post. But first, some FAQs about the second edition:

Wait…this is a cookbook?

The book tackles hundreds of real-world regular expression tasks in a problem, solution, discussion format. There's also a detailed regular expression tutorial included, in the same format. Check out Jeff Atwood's and Ben Nadel's reviews of the first edition, which have more details about this.

Update: Rob Friesel Jr. posted an awesome, detailed review of the second edition.

The first edition was a bestseller, and is now available in eight languages. It briefly held Amazon's #1 spot for computer books upon its release in mid 2009, and the ebook version was O'Reilly's top seller of 2010.

What has changed with this new edition?

The second edition adds more content, and updates existing chapters. There are innumerable improvements, including the most noticeable addition of a new chapter written by Jan, titled Source Code and Log Files, and various new recipes interspersed with four of the other chapters.

There are 101 new pages in the second edition, and that's after shortening and removing some content from the first edition. There were 125 recipes in the first edition, upped to 146 in the second. Note that many of the book's recipes provide solutions and in-depth discussions for more than one problem. Tons of changes, ranging from minor copyedits and errata corrections to major revisions and the addition of significant new content, were made throughout the existing content. Everything was brought up to date with the latest standards, tools, and programming language versions. In particular, updates to Java and Perl since the first edition brought very significant regular expression changes. Plus, we've covered some advanced regular expression features that already existed the last time around, but didn't make it into the first edition.

The first edition was already groundbreaking for the depth of its explanations and its equal coverage of all regexes in eight programming languages (C#, Java, JavaScript, Perl, PHP, Python, Ruby, and VB.NET). The second edition significantly improves upon this by providing even more details about the many peculiarities and differences of the APIs, syntax, and behavior of these regex flavors and programming languages. The second edition also adds coverage of XRegExp when it provides a better solution than native JavaScript. IMO, the second edition is easily the most comprehensive source of information about the use of modern regexes across multiple programming languages—far more detailed than anything else in print or online.

What will interest long-term fans the most?

Even though there are lots of important changes throughout the book, the new recipes and the updated coverage for the latest programming languages are probably the main reasons for owners of the first edition to upgrade. The fully-new recipes cover creating a regex-based parser, validating password complexity, adding thousands separators to numbers, matching various kinds of numbers, decoding XML entities, and everything in the new Source Code and Log Files chapter. The coverage of XRegExp is also completely new in the second edition.

What will cause readers to trip over themselves in their haste to buy a copy?

If you read though the book, you'll learn about a lot of things—much more than just regular expressions. You'll almost certainly learn something new about Unicode, phone numbers, and XML, as just a few examples. You'll learn that the eighth floor of the Saks Fifth Avenue store in New York City has its own ZIP code, which also happens to be the only ZIP code that includes letters. You'll learn that the Chicago Manual of Style and Merriam-Webster's Biographical Dictionary disagree on the correct alphabetical listing of the name Charles de Gaulle (my girlfriend and I are in opposing camps). Jan and I put a ton of research into the book, and we pay attention to details. I think that shines through.

Oh yeah, and along the way, you'll also become a Master Chef of regular expressions, able to slice and dice text with the best of them. But not everyone will want to actually read through the book. Some readers will prefer to take advantage of the cookbook format and read only the parts that solve their immediate problems. That's fine, too.

Many developers complain that they're continually relearning regular expressions, going back to the reference documents every time they need to write a new regex. The problem/solution approach of Regular Expressions Cookbook means you learn by doing, and we think that helps the details stick with you more securely than with the other books and websites out there.

Many regex novices turn to Google to get prewritten regexes that solve their problems. Unfortunately, if you're not already fluent in regex, you won't realize that 90% of the regexes out there have some kind of problem, be it returning false positives or negatives, performing inefficiently (or maybe even crashing your server when fed malicious data), being more complicated than necessary, not being portable, or what have you. When you use the regexes in Regular Expressions Cookbook, not only do you get detailed coverage of all the related issues (which helps you customize the solution, if necessary), you also get the peace of mind that you're using proven solutions by real subject-matter experts.

So how do I enter to win a free copy?

Simply comment on this blog post on or before 11:59 PM EDT on September 7th, and you'll be in the running. I wish I could leave the contest open a bit longer, but I'll be moving to California to work for a little Internet startup. You'll need to use your actual first and last name and email address with your comment. Names are published, but email addresses are not. Each person commenting has only one chance to win, regardless of how many comments they post. If you don't know what to write in your comment, just mention whether you'd prefer a print or ebook copy.

Shortly after this contest ends, I'll randomly choose 15 winners and contact them by email. If you prefer a printed copy, I'll be asking for your address and, if you're outside of the U.S., your phone number. O'Reilly will pay for shipping to anywhere in the world. Good luck!

Book sampler

Coauthor Jan Goyvaerts has written up his own summary of the changes in What's New in The Second Edition of Regular Expressions Cookbook.

Follow me on Twitter @slevithan or on GitHub at slevithan.

There Are 401 Responses So Far. »

  1. s/i wish i owned an ebook of the regex cookbook/i am a proud owner of the regex cookbook/g

  2. Time to dive into regex!

  3. Count me in! (e-book copy)

  4. pls sign me in

  5. Help me improve my regex!

  6. Good Luck! Love your book!

  7. Yes please πŸ™‚

  8. Beeing a student working with perl scripts – I could really use this great book to deepen my insights in regex!

    Thanks for the opportunity to sign in! Regards, Robert

  9. I’d be glad to have one.

  10. I love regular expressions, so would be great to have one too. πŸ™‚

  11. Doing regular expression work, so would be great if I could get a printed copy of the book.

  12. I would like a copy! in print please πŸ˜€

  13. put me in the draw for an ebook

  14. I would love to have one copy please. It will really help in my current project.

  15. Please put me in the drawing for an eBook version. thanks.

  16. I learned rudimentary regex skills early in the ’90s. I don’t think a week goes by where I pull some magic regex shortcut out of my skills hat. I’m really looking forward to expanding my skills with thev2nd edition of the Cookbook.

  17. I love this http://www.regexpal.com/ web for writing data provider files for matching billing page.

    If i got this free Book i am very happy to read and give suggestion also.

  18. Unix/Linux user of regexes since the eighties. Time to get that ebook πŸ™‚

  19. I would like to try for a free copy. by date I think I’m out, but http://regexpal.com/ site mentioned today is the last day..

  20. one copy for Kindle, please

  21. comment πŸ™‚

  22. hi,
    I need an ebook copy.

  23. I’ve used (and continue to use) regular expressions in Perl, JavaScript, PowerShell and ColdFusion. It amazes me that I can still find “good stuff” like the examples in Steven’s “Regular Expressions Cookbook 2nd Edition”, but it shouldn’t. This is a must-have for the technical bookshelf…

  24. Thank you for sharing your info. I really appreciate your efforts and I will be waiting for your further write
    ups thanks once again.

  25. SugusQQ merupakan Situs Agen BandarQ Terbaik 2019

  26. LigaIBC merupakan Salah satu situs Agen Bandar Sbobet Terbaik dan Terpercaya di indonesia

  27. LigaQQ adalah Agen BandarQ Terbaik dan Terpercaya Sepanjang Sejarah di Indonesia

  28. SugusQQ menyediakan Bandar Judi Sakong Online Terbaik dan Terpercaya 2019

  29. Money Room merupakan salah satu situs yang memberikan ulasan situs perjudian online diindonesia

  30. Great, thanks for sharing this blog. Want more.

  31. If you want to obtain much from this piece of writing
    then you have to apply these strategies to your won weblog.

  32. Di waktu senggang alangkah baiknya mencoba bermain poker online di website duetqq.

  33. inilah link yang bisa anda follow sekarang juga lalu dapatkan hadiahnya https://miarroba.com/duetqiu

  34. Game online terbaru dalam gaming online , harus dicoba ya : https://miarroba.com/duetqqsite

  35. https://bit.ly/38Jooxs menyediakan informasi seputar permainan pkv games.

  36. https://miarroba.com/christyangel memiliki jalan terbaik ketika anda sudah bosan mengalami kekalahan.

  37. Ketika sudah mendapatkan kartu straight lebih baik menunggu hingga babak akhir untuk raise dalam permainan http://alturl.com/en3gb

  38. babak akhir suatu permainan sangat penting sekali karena disini babak akhir untuk bisa memasang taruhan https://miarroba.com/partaiqqvip

  39. Game terbaru dan terupdate di setiap minggunya : https://miarroba.com/duetqiunet

  40. Kumpulan daftar game online terbaru https://miarroba.com/listbandarqiu

  41. Seru dan mainkan , ayo segera ikut gabung bersama kami dan menangkan hadiahnya : https://miarroba.com/partaiqqlink

  42. Babak terakhir dalam permainan kartu poker adalah memperlihatkan 5 buah kartu di meja http://partaiqq.online

  43. Banyaknya kemenangan bisa menjadikan pemenang kaya raya dalam sekejab.

  44. Permainan kartu remi dan domino paling aman dengan taruhan besar http://alturl.com/69mfv

  45. Permainan kartu remi dan domino dengan meja terbesar dan juga meja vip https://miarroba.com/partaiqqsite

  46. Having read this I thought it was rather enlightening. I appreciate you finding the time and energy to put this information together. I once again find myself personally spending a significant amount of time both reading and posting comments. But so what, it was still worthwhile!

  47. ketika bermain dalam permainna online. Dipastikan anda bisa mendapatkan kemenangan dengan mudah ketika bermain. Hal ini adalah salah satu cara terbaik dan luar biasa.

  48. Mau meraih kemenangan hingga puluhan dan ratusan juta rupiah??

    Tentu bisa, Berikut Bandar Judi terpercaya dan aman untuk di mainkan…

    Banyak agen judi online disana yang terpercaya, bettors hanya perlu memilih salah satunya yang dirasa merupakan cocok untuk bettors jadikan tempat bermain…

    Pilihlah sekarang juga dan menangkan uang sebanyak mungkin sekarang juga!!!


  49. JANJIQQ menjadi satu satunya situs judi online yang paling fairplay tanpa ada robot maupun admin. Penarikan dana berapaun pasti akan diproseskan!!!

  50. Great Article

Post a Response

If you are about to post code, please escape your HTML entities (&, >, <).