#166 in Computers & technology books

Reddit mentions of Mastering Regular Expressions

Sentiment score: 14
Reddit mentions: 25

We found 25 Reddit mentions of Mastering Regular Expressions. Here are the top ones.

Mastering Regular Expressions
Buying options
View on Amazon.com
or
    Features:
  • O Reilly Media
Specs:
Height9.19 inches
Length7 inches
Number of items1
Weight1.89156620796 Pounds
Width1.3 inches

idea-bulb Interested in what Redditors like? Check out our Shuffle feature

Shuffle: random products popular on Reddit

Found 25 comments on Mastering Regular Expressions:

u/Jesseroonie · 20 pointsr/vim

[edit: Missed a line when I saved; I'm not using vim keys in my browser] I loved this article! I hope you don't mind if I share a story.

I've been in IT professionally for 14 years, and computing for 35 years. I taught myself vim for log analysis, and it's paid off in so many ways that I evangelize about it.

Vim, by itself, is honestly only a bit useful if you give it only a surface examination. You can use Visual Mode (control V, then movement keys) to select blocks of text for removal, cutting, or pasting. However, a copy of Notepad++ will do the same, so at that level, meh. It's admittedly not user friendly at all coming in from the outside.

However, if you're willing to learn some Regex (and I can't recommend Mastering Regular Expressions (Amazon) strongly enough, then that's where vim really shines. I use it for cleaning up data daily, and between a strong understanding of regular expression, visual mode selection, and macros, I've done cleanup of data coming from odd sources in minutes that would have taken hours of work manually.

I'd love to give you a flat recipe on how to do some of what I do, but the thing about vim and data cleanup work is that the data coming at you for analysis is irregular, so your approach must be flexible. You learn the tools, not a recipe or two, and it takes time. I spent weeks in vim before it really clicked.

I spent time first in vimtutor (packaged with vim), and then w/ Mastering Regular Expressions. Once I had at least a rough understanding of :substitute (vim.wikia), that opened a lot of doors, and that's when I dropped using any other editor for raw text.

Here's an example of some of the things I find myself doing. I had a client the other day who had performed a change to an inventory control system that was filled with mistakes; the system has no undo, and the only record she had left (due to continued PEBKAC) was a PDF report she'd run before making things worse. Said PDF had data split across multiple lines, otherwise filled with garbage and oddball white spaces, and also had some duplicate rows within it. I exported it to text.

I needed to trim out all but two different forms of lines, then eliminate duplicates, then join the two altered line elements together into a single delimited line, flipping the last field from a negative to a positive number (or vice versa) which I could then use to make the corrections to her system. The end result was a 20,000 line file, so it was a lot longer before that.

I was able to transform the PDF in about 20 minutes.

Now, I've learned a few languages since, and I very well could have written a tool to do the job for me, however my relationship with massaging text in vim is such that, thanks to undo/redo, and the experience I've built up, it's actually faster for me to manipulate the file in real time than to alter script, execute, examine, adjust script, and repeat. Vim excels at working with large files, so while it's theoretically possible to do the same work in other editors, I've not found one that will handle massive sets of data with the same speed.

One other thought; if you are also willing to learn a little bit of Unix and pipeline, then invoking shell commands opens up a lot more doors, since Unix has massive amounts of tools and scripts available.

I really hope this helps you!

u/burntsushi · 9 pointsr/rust

> especially since the model of delegating un-fancy regexes to an NFA is what I thought that PCRE etc. were already doing

I think the prevalence of things like possessive quantifiers suggests this isn't the case. Even if you run simple regular expressions (as in, yes, really "regular") like (a*)*c against a string like aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, it will take a very long time to execute. If PCRE dropped back to a real NFA, then such behavior wouldn't be observed.

To make things even more confusing, PCRE actually has something called an "alternative matching algorithm" exposed as pcre2_dfa_match (it's also in PCRE1). It is not actually a DFA, but it uses something called the "DFA algorithm," which was a misunderstanding that has spread to many minds. In particular, the PCRE folks consider their implementation to be an instance of the "NFA algorithm." The actual facts, AFAIK, are that the standard PCRE engine uses backtracking, not NFAs, and the "alternative matching algorithm" uses an actual NFA, not a DFA.

u/fried_green_baloney · 5 pointsr/Python

Toward the end of this book there is a two page regex to validate email addresses:

https://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124

It's a big hairy subject if you are serious about getting it 100% correct.

u/andlrc · 4 pointsr/vim

Mastering regular expressions is a really good book for them who seeks to understand how regular expressions can be successfully applied, and also avoiding many of the pitfalls introduced by careless use.

For my day-to-day use it caries few benefits though as I usually only scan source code and a some-what poor regular expression is sufficient.

regular-expression.info have a nice write-up of each flavor.

[1]: https://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124
[2]: https://www.regular-expressions.info/

u/tsammons · 3 pointsr/PHP

Mastering Regular Expressions is necessary reading material for anyone who wants to dive deep into regex syntax. Once you're in the murky depths of atomic and lookaround hell, RegexBuddy is a great tool to evaluate your expression real-time.

Don't go too crazy into it though lest you invoke ZA̡͊͠͝LGΌ.

u/Rhomboid · 3 pointsr/learnpython

There are a million and one uses for regular expressions:

  • parsing, i.e. extracting structured data from a giant blob of text
  • searching for things that match a given pattern
  • reformatting text from one form to another
  • validating whether text matches a certain pattern

    If that sounds vague it's because it is. Again, regular expressions are a general tool that can be used in countless ways, and this really isn't a topic that can be explained in a paragraph. People have written entire books on the subject, and you aren't going to get a cogent summary in a reddit comment. (Once upon a time I tried to do that -- explain regular expressions in a reddit comment. It was very long, and people seemed to enjoy it, but I don't think I covered even a fraction of what you'd need to know to be able to use REs. And because of reddit's decrepit, shitty system, I have no way of finding that comment ever again because you can only view the last 1000 comments of someone's history and I post a thousand comments every few months, and this was several years ago. End rant.)

    My advice if you don't immediately see the power of the RE is to just let it go and go on with your day. You don't have to know everything. Eventually, you will run into some code that solves some task using a regular expression, and at that point you have something concrete to look at. Try writing a solution for the problem without using a RE, and compare it to the solution that does use a RE. Take apart the RE and learn how it works. Then you can compare the two solutions to see which one is better.
u/gawdnfreeman · 2 pointsr/sysadmin

Three esxi servers, each with more than one NIC, and one separate vcenter server is a great starting point. This allows you to tune DRS, HA, and even fault tolerance. Once you get that down, you'll want to be able to tune VMs properly to run most effectively in a virtual environment.

I enjoyed reading these books, though some are "dated" now, the contents are still very relevant. They won't get you anywhere in particular by themselves, but when you combine them with the self-teaching nature of sysadmins I've previously described, these will generously add to your toolset.

HA and DRS deepdive
Sed & Awk

Mastering Regular Expressions. I use rubular.com often.

Pro Puppet

Anything by Bruce Schneier is usually worth your time.

Though I no longer administer a large number of Windows machines, I am a huge fan of Mark Minasi. The Server 2003 book was super helpful in building and maintaining Windows Domains.

I have an old edition of the DNS and Bind book kicking around somewhere.

Understanding the Linux Kernel has largely been useful to me when doing anything "close to the kernel". Not a good beginner's book.

I've never used an apache book, but I enjoyed the Varnish book. This definitely helped me.

Of course, these books don't cover everything, and those listed are relevant to my interests so your mileage may vary. You'll never go wrong teaching yourself new skills though!

EDIT: I forgot about the latest book I've read. I used tmux for a little over a year before purchasing a book on it, and it has improved my use of the program.

u/frumsfrums · 2 pointsr/SublimeText

I would recommend Mastering Regular Expressions for a gentle and accessible introduction to the topic. Seems like this is the primary thing you want.

Sublime also has multiple cursors. This lets you do certain things you would have done with regex interactively and without thinking, so that's another useful thing to know.

Apart from that, just familiarise yourself with all the buttons and toggles on the Find dialog and you should be good!

If you want to try a programming language, I'd recommend Python, as Sublime is very Python-friendly (just open the console and type expressions in, or try writing some simple plugins), and Python has great regex support, so is often used for slicing text up as well.

u/Empiricist_or_not · 2 pointsr/HPMOR

<Edit:>
For storytelling there is a list of fairy tale tropes that occur in a given order, someone did a paper on it in analysis of Russian fairy tales, but I don't have the time to Google it. The below is more for programming.
</Edit>


Regular expressions: Oriely Mastering Regular Expressions Very useful for pattern matching in text.

u/poloppoyop · 2 pointsr/programming

No "Working effectively with legacy code". Which could be titled "Pragmatic testing".

The DDD blue book, ok. But you'd be better served with "Implementing Domain-Driven Design" which was written 10 years later and have a lot less focus on the technical implementation of DDD.

Mastering Regular Expression should be there too.

u/Aswole · 2 pointsr/dailyprogrammer

Not sure how serious you are, but I was inspired to get better at RegEx when someone solved this problem that someone dedicated an entire project to in one line of regex. After a bit of research (not too much, as a lot of people pointed to it), I bought Mastering Regular Expressions. I'm reading it on and off, and about 30% of the way through, but even after a hundred pages or so, I felt so much more comfortable with them. Already applying a lot to solving work problems, and able to read expressions constructed by others much more comfortably. I highly recommend.

u/Ostwind · 2 pointsr/learnprogramming

Well most peoply I work with don't know them or only know the basics, e.g. that you can match strings of unknown size.

I'd say that you don't really need more than that, though it occasionally is very handy.

Read the Friedl! It's for beginners too and will tell you everything you need to know and more.

u/CSMastermind · 2 pointsr/AskComputerScience

Senior Level Software Engineer Reading List


Read This First


  1. Mastery: The Keys to Success and Long-Term Fulfillment

    Fundamentals


  2. Patterns of Enterprise Application Architecture
  3. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions
  4. Enterprise Patterns and MDA: Building Better Software with Archetype Patterns and UML
  5. Systemantics: How Systems Work and Especially How They Fail
  6. Rework
  7. Writing Secure Code
  8. Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries

    Development Theory


  9. Growing Object-Oriented Software, Guided by Tests
  10. Object-Oriented Analysis and Design with Applications
  11. Introduction to Functional Programming
  12. Design Concepts in Programming Languages
  13. Code Reading: The Open Source Perspective
  14. Modern Operating Systems
  15. Extreme Programming Explained: Embrace Change
  16. The Elements of Computing Systems: Building a Modern Computer from First Principles
  17. Code: The Hidden Language of Computer Hardware and Software

    Philosophy of Programming


  18. Making Software: What Really Works, and Why We Believe It
  19. Beautiful Code: Leading Programmers Explain How They Think
  20. The Elements of Programming Style
  21. A Discipline of Programming
  22. The Practice of Programming
  23. Computer Systems: A Programmer's Perspective
  24. Object Thinking
  25. How to Solve It by Computer
  26. 97 Things Every Programmer Should Know: Collective Wisdom from the Experts

    Mentality


  27. Hackers and Painters: Big Ideas from the Computer Age
  28. The Intentional Stance
  29. Things That Make Us Smart: Defending Human Attributes In The Age Of The Machine
  30. The Back of the Napkin: Solving Problems and Selling Ideas with Pictures
  31. The Timeless Way of Building
  32. The Soul Of A New Machine
  33. WIZARDRY COMPILED
  34. YOUTH
  35. Understanding Comics: The Invisible Art

    Software Engineering Skill Sets


  36. Software Tools
  37. UML Distilled: A Brief Guide to the Standard Object Modeling Language
  38. Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development
  39. Practical Parallel Programming
  40. Past, Present, Parallel: A Survey of Available Parallel Computer Systems
  41. Mastering Regular Expressions
  42. Compilers: Principles, Techniques, and Tools
  43. Computer Graphics: Principles and Practice in C
  44. Michael Abrash's Graphics Programming Black Book
  45. The Art of Deception: Controlling the Human Element of Security
  46. SOA in Practice: The Art of Distributed System Design
  47. Data Mining: Practical Machine Learning Tools and Techniques
  48. Data Crunching: Solve Everyday Problems Using Java, Python, and more.

    Design


  49. The Psychology Of Everyday Things
  50. About Face 3: The Essentials of Interaction Design
  51. Design for Hackers: Reverse Engineering Beauty
  52. The Non-Designer's Design Book

    History


  53. Micro-ISV: From Vision to Reality
  54. Death March
  55. Showstopper! the Breakneck Race to Create Windows NT and the Next Generation at Microsoft
  56. The PayPal Wars: Battles with eBay, the Media, the Mafia, and the Rest of Planet Earth
  57. The Business of Software: What Every Manager, Programmer, and Entrepreneur Must Know to Thrive and Survive in Good Times and Bad
  58. In the Beginning...was the Command Line

    Specialist Skills


  59. The Art of UNIX Programming
  60. Advanced Programming in the UNIX Environment
  61. Programming Windows
  62. Cocoa Programming for Mac OS X
  63. Starting Forth: An Introduction to the Forth Language and Operating System for Beginners and Professionals
  64. lex & yacc
  65. The TCP/IP Guide: A Comprehensive, Illustrated Internet Protocols Reference
  66. C Programming Language
  67. No Bugs!: Delivering Error Free Code in C and C++
  68. Modern C++ Design: Generic Programming and Design Patterns Applied
  69. Agile Principles, Patterns, and Practices in C#
  70. Pragmatic Unit Testing in C# with NUnit

    DevOps Reading List


  71. Time Management for System Administrators: Stop Working Late and Start Working Smart
  72. The Practice of Cloud System Administration: DevOps and SRE Practices for Web Services
  73. The Practice of System and Network Administration: DevOps and other Best Practices for Enterprise IT
  74. Effective DevOps: Building a Culture of Collaboration, Affinity, and Tooling at Scale
  75. DevOps: A Software Architect's Perspective
  76. The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations
  77. Site Reliability Engineering: How Google Runs Production Systems
  78. Cloud Native Java: Designing Resilient Systems with Spring Boot, Spring Cloud, and Cloud Foundry
  79. Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation
  80. Migrating Large-Scale Services to the Cloud
u/dotnil · 1 pointr/web_design

to know regular expression thoroughly I recommend Jeffrey's Mastering Regular Expressions.

u/djdawson · 1 pointr/learnpython

The O'Reilly book Mastering Regular Expressions is very complete if you really, really want to know all the gory details of regular expressions.

u/jpeek · 1 pointr/Cisco

Welcome. Regex(Regular Expressions) allows you to parse text more efficiently. Mastering Regular Expressions is what you need to look into.

u/skibo_ · 1 pointr/compsci

Well, I'm a bit late. But what /u/Liz_Me and /u/robthablob are saying is the same I was taught in NLP classes. DFA (Deterministic Finite Automatons) can be represented as regular expressions and vice versa. I guess you could tokenize without explicitly using either (e.g. split string at whitespace, although I suspect, and please correct me if I'm wrong, that this can also be represented as a DFA). The problem with this approach is that word boundaries don't always match whitespaces (e.g. periods or exclamation marks after last word of sentence). So I'd suggest, if you are working in NLP, that you become very familiar with regular expressions. Not only are they very powerful, but you'll also need to use them for other typical NLP tasks like chunking. Have a look at the chapter dedicated to the topic in Jurafsky and Martin's Speech and Language Processing (one of the standard NLP books) or Mastering Regular Expressions.

u/Carpetsmoker · 1 pointr/vim

pattern.txt is more of a reference manual not exactly a great introduction. I'm not entirely sure what would be one, though. I can recommend you Mastering regular expressions, but that's not free, and perhaps a bit more than you need ;-)

Also: be aware that Vim regular expressions are different from many others! Basic patterns (like this) will work, but some of the more advanced ones are different (like .*? being .\{-} in Vim). Still, once you grasp the idea behind it, it should be easy to port the idea to Vim ;-)

u/SkepticalMartian · 1 pointr/PHP

Buy Mastering Regular Expression and you'll essentially have the /[A-Z]/i guide for regular expressions.