

Ask HN: Do I need a regex book? - solipsist

I'm starting to learn ROR and have noticed that regular expressions show up quite often. I'd like to get a solid understanding of them, but no online tutorial seems to be sufficient.<p>I've seen that the books like <i>Mastering Regular Expressions</i> and <i>Regular Expressions Cookbook</i> have great reviews on Amazon, but I'm wondering if it would be overkill to get a full book on something that I would only be using every so often.<p>I've also considered getting a reference book on regex, but those seem to offer no introduction/explanations whatsoever (which I need).<p>Is it worth it for me to read up a lot on regex?
======
Someone
1\. You mention RoR, so I assume you are not aiming to understand the abstract
computer science notion, but the practical thing as to what regular expression
libraries (ruby's in particular) understand.

2\. You do not mention which online tutorials you found insufficient. That
makes it hard to recommend things. For example do you know about
<http://www.regular-expressions.info>?

3\. Have you played with regular expressions interactively? That could be
through the command line, or via <http://rubular.com/> (there are tons of such
tools online, some better, but this one is for ruby)

As to your last question: whether it is worth for you? That depends on way too
many unknowns for me to answer.

------
throwaway628
[http://inst.eecs.berkeley.edu/~cs164/sp11/lectures/lecture2....](http://inst.eecs.berkeley.edu/~cs164/sp11/lectures/lecture2.pdf)

start at page 4.

~~~
rhizome
It doesn't seem to me like the OP is looking to start with something that uses
set notation.

------
rhizome
The best reference materials for regular expressions are available for free on
all operating systems that have Perl installed: `perldoc perlretut` and
`perldoc perlre`, in that order.

EDIT: ...in a terminal window.

------
staunch
Yes. Read Mastering Regular Expressions.

~~~
bavcyc
Regexes are a handy tool to know regardless of the language. And something I
think is worth learning.

Mastering Regular Expressions is a good book to read as Mr. Friedl does a good
(great?) job of explaining the pluses and minuses of regular expressions in a
readable manner.

If all you want is how to use regular expressions then there are plenty of man
pages and internet documents which provide examples that you can learn from
without reading Mastering Regular Expressions.

You might look at the Ruby documentation to see how Ruby does things. And a
quick search using Ruby regular expression provided this link:
<http://rubular.com/> which is a utility to test regexes. There are several
other links immediately following this one which appear to be tutorial or
information for what you are looking for.

