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!
Coauthor Jan Goyvaerts has written up his own summary of the changes in What's New in The Second Edition of Regular Expressions Cookbook.
I am also interested in this publication.
—–
I forgot to mention I would prefer a print copy. Now, off to the theatre.
I also want a printed copy. Hope to be a lucky one.
Great contest! I could go with eBook or print version, whichever is easier.
Hungry for knowledge
Lover of free
Please, oh please,
Do pick me
I am very interested in read Regex Cookbook 2nd edition.
Thanks for doing this!!!!
Cool I would love a print version of it!
I’ve been following your insane ability in regex since I first picked up EditPad Pro … I can’t wait to read the new book … Sucks that I’m no where near the first fifteen … I’ll definitely be getting the book one way or the other … Regular Expressions have been the catalyst to all things successful in my programming career …
i’d love to win a copy of this book (preferably the print version) regex is uber essential!
@Steve Congratulations on your new gig … the devs over there are going to hate on your skillz like mad … π
I’ve always *loved* regexp, though I certainly could improve a lot thanks to this book ! I’d love to win an e-book copy of it !
I was asked a question about regular expression in one of my job interviews. This book would help me.
I’d love to win a copy and get my regex’s on π
I really loved the first edition. Would love to get started on the 2nd! Cheers from the Netherlands
Good morning
Strangely enough, although regex is such a versatile and useful tool, I don’t actually get to use it as much as I would wish during my day to day work life. If I could be lucky enough to own a copy of Regex Cookbook, I’d like to own a printed copy, to always have it handy (I find that ebooks tend to find a folder on my pc, and generally settle there…I am still to acquire a decent ebook reader).
Kind regards
Stafleu
I hope it’s not too late to participate !
I love to win one !
nice job
Hey, i want my one too π
I love regex and also read the 1st edition one.
Would prefer an e-book version one so easier to read in tablet. π
Cheers from a Hong Kong reader here. π
Certainly, the best book on regex.
eBook for me.
I would love to win a copy π *fingers crossed*
I would love to win a copy π *fingers crossed*
—–
Oops, forgot to mention I would prefer an eBook copy if I win!
I always loved reading the O’Reilly books. They are always filled with knowledge and so useful throughout my day. Hopefully I can get a e-copy of this book to add to my O’Reilly collect.
I’l love a printed copy
count me in!
Yippie! Exactly what I need. I would like to be enetered into the contest for the book!
I’d love a big old printed copy. The better to impress those who walk past my desk at work and see my geek cred. π
I’ve heard version 1 was amazing. I’d love a printed copy if I’m selected.
RegexPal brought me here! I’d love to win a printed copy!
Thank you for the awesome work you done !
I have the first edition — love it!
How are you going to extract the submission names from this page? Surely not regexes on HTML!?!?!!
I’d like the chance to win a printed copy.
Thanks!
I would absolutely love an ebook copy. I am just getting started with regular expressions and am quickly learning the immense power they hold.
I’d really like to win the book, so count me in
I would love this read this book since I’m still learning on how to create reg ex.
Hope I’ve got one.
Thanks,
If I get an e-book I will start believing in miracles because there are already 500 people commented instead of 15 π
I use regex everyday. I would love a printed copy of this book!
I want this book! π
I guess there is no chance of a signed version π
Hi Steven,
Congrats on the new job at Facebook! You are a regex whiz and this book will be gold. If I happen to win a copy, I’d prefer print.
Thanks!,
-Aaron
Congratulations Steve,
This is a great book to posses. Will be glad to have one.
Prefer a printed copy.
Expecting more such books.
regards
Vidyasagar
Good luck on the new opportunity. Kudos to all regex gurus like you who are willing to help the rest of us muddle through it because we have to. If I happen to win a book, I’d prefer a print copy.
-Burton
This is one book I really need…regular expressions are a mystery to me!
OoOoOoOo⦠I do wish to own a copy of this book.
Loved the first one, dog-eared, coffee stained and loaded with about a billion post-its for my favorites. Cook-book is an understatement, it is a life preserver! Thanks for the great resource!
Yes, please. Want. Regular expressions to me are like me and the Force. I recognize they can be very powerful, but I have not yet been to Dagobah.
print copy please!
Would love to get a copy in print. Count me in too! π