#15 in Personal computer books
Use arrows to jump to the previous/next product
Reddit mentions of Mastering Regular Expressions: Powerful Techniques for Perl and Other Tools (Nutshell Handbooks)
Sentiment score: 1
Reddit mentions: 2
We found 2 Reddit mentions of Mastering Regular Expressions: Powerful Techniques for Perl and Other Tools (Nutshell Handbooks). Here are the top ones.
Buying options
View on Amazon.comor
- Used Book in Good Condition
Features:
Specs:
Height | 9.19 Inches |
Length | 7 Inches |
Number of items | 1 |
Weight | 1.322773572 Pounds |
Width | 0.85 Inches |
I'll just leave this here.
Tools like the one at gskinner.com are handy, but they're definitely not a replacement for learning how regex works, and why.
Until one has a solid grasp of how regex works, I'd recommend staying away from the community contributions. Assuming something works without understanding how to read it sometimes leads to bad things happening.
I could probably have a field day in there, but I'll limit it to one example:
this regex from gkskinner.com promises to parse a URL
However there are several problems with it because it is not written to be compliant with the RFC spec. First, it doesn't take in to account the entire format of a URL. http://foo:bar@baz.com is a valid url, but it captures "foo:bar@" as the path of the URL, and "baz.com" as the file.
Similarly, using a port, such as: "http://baz.com:3000" - the regex matches :3000 as the path.
Because of the way this regex is designed, with each part being optional, it can't actually fail to match unless the input string contains a newline. Even if the input is a URL that is extremely broken.
Go get yourself a copy of O'Reilly's Mastering Regular Expressions. It covers not only Awk and Sed, but also PERL and PCRE and several others. Having a good healthy understanding of regex makes quite a few sysadmin tasks a LOT easier, especially with things like Puppet etc relying so heavily on them.