Removing leeon from the toilet-book reviews proficient in Regular Expressions

Source: Internet
Author: User
Tags egrep

The world of computing is probably composed of rules. From the simplest binary operations to the complex formatting of text, and
Various protocols for building interconnected networks, the entire industry has been customizing, replicating, and customized for decades.
As everything became more and more complex, we finally worried about "analyzing these originally well-regulated data. Because
When the number of rules reaches a certain level, the rules themselves are lost.

The tool for finding and describing rules from a series of data is a "regular expression"-in the early days, it was true
Is translated as a "rule expression ". More importantly, today's various languages have built-in strong regular expression support
Rules can be reused, programmed, and used for reasoning. Of course, the premise is that you need to understand
Then the expression "its own rules-a collection of symbols like tianshu.

The father of JavaScript once created a project that uses a subset of Rule expressions embedded in the JS engine to implement
A set of JavaScript syntax analysis and execution engines: "JS (JS implemented in JS) implemented in JS )".
Taking the analysis of K code as an example, this engine takes about 8 minutes. However, after optimization of the regular expression, this can reduce
To less than 8 seconds. I think, if Brendan eich uses an incorrect regular expression, not many people can say that
Familiar with regular expressions.

Among those few, it should include Jeffrey E. F. Friedl, author of "proficient in regular expressions. When I
When I saw this article "proficient in regular expressions", I was confident in my opinion.

Read this book carefully. I think the greatest value of this book for an experienced reader is:
-Give you the opportunity to understand the genre, origins, and differences of various regular expressions;
-Let you know how to effectively optimize and evaluate the performance of regular expressions;
-Familiarizes you with the details and traps of regular expressions.

As a matter of fact, as a language user, these are the only ways to go deep. Generalization of language comes from
The impact of environment is not limited to the essence of the Creation. Have the opportunity to understand the initial settings of these sources.
It is very beneficial. Performance, details, and traps are the magic weapon for debugging errors in the project.
The manual like expression is on the side, which saves a lot of effort.

For the author, the most difficult part of this Article "proficient in regular expressions" is probably in the content organization. No matter you are a beginner
It is difficult to find a good learning start point in regular expressions. Fortunately, Jeffrey did find
. The first and second chapters of this book will make readers find a little clear in the disorder of regular expressions.
Impression.

I also appreciate the writing of the book "proficient in regular expressions. For a long time
Regular Expression developers introduce the principles of regular expressions and are considered an impossible task. However
In this book, the author uses a very intuitive legend to describe a complete set of methods for analyzing regular expressions.
All the complicated and inexplicable code (such as dynamic expressions used for nesting in Perl) is clearly explained.

On the other hand, Yu Sheng's translation also impressed me a lot. In my opinion, the most troublesome thing to read is that some Nouns
Different Translation methods, for example, where the interface is translated as "interface" and "interface", are a major difficulty. Many translators are doing this.
Is under criticism. Mr. Hou Jie's previous practice was to explain before the manuscript, and then attach a translation table to the manuscript.
Later, translated tables became a standard "Hou's Translation ". Some translators choose a more convenient method.
Followed by an English word. Mr Yu Sheng used this translation, for example, "a series of letters and numbers
(Alpha numeric characters )". If this translation method is not used, it is difficult for the Chinese translation version to be so fluent.

When I was studying, I remembered my friend leeon. He always likes to put books in the toilet, so that he can connect to "programming language design-practice ".
He is also listed as a "toilet book. I always want to tell him that this is a kind of physiological and psychological
I am not very familiar with it, but I finally did not do this. Because for a stubborn person, the only way to change his habits
Is to block his habits, rather than some form of proverbs.

Now, I can finally recommend this article "proficient in regular expressions" to him. This is the only thing I believe that leeon is unusable.
A book that has been read on the toilet for a long time. Because complex regular expressions can be written as books of heaven
The explanation will surely make leeon unable to stop the impulse, so that it will be ejection from the toilet to the computer to write
To do the test.

Of course, leeon still has some procedural work to do before ejection. However, I think that is not the work of this book.
Problems to be considered. ^. ^

Also:
-----

However, I am not satisfied with Jeffrey's use of egrep as an example for regular expression beginners. I even think that
The tiny tool named findstr in the doscommand line is a good example.

Jeffrey is clearly not Microsoft's fans, and the Perl language that supports regular expressions is not so close to micro
Soft platform. Therefore, Jeffrey did not see a small tool like findstr, which is probably not a problem. Only
It is not easy for readers to find a tool named egrep for the first two chapters of the experiment.

Back to the beginner's topic, I still recommend that Beginners use a common tool for basic testing. When I analyze the source code
This is a good recommendation for readers who are used to using grep (turbo grep, released with Borland,
Using findstr is also good. Of course, if your language supports regular expressions, and you already have some practical experience
If you do not have these suggestions.

Basic use of findstr:
----
Findstr/R "<a regular expression>" *. txt

Basic use of grep:
----
Grep-R + "<a regular expression>" *. txt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.