Regular expressions learning (1)

Title and Python regular expressions to learn (1)

Regular expressions also known as conventional notation, formal notation (English full name regulal - "[There are rules, laws] expression-" [Table of way, said expression], abbreviated as regex, or regexp), it is more accurate concept is described using a single string. In line with a series of string matching syntax rules, he said simply, is to use a common set of single string matching the description of a series of line with the rules of the string, which is an abstract expression of the target string.
Well, the regular use of expressions Where is? That is, can be used in those scenes? Which in turn can be used in the environment?
The difference between the scene and the environment as well as scenes and the environment under the following to say.
For example, we write a program, log on a Web page, or whether it is a game, and so we expect, for example, a user logs need to check any input values, when the user enters the password, we may need to check the compliance with our password strength after expectations, or the user to enter a password, enter discovery is a special symbol, it will be some conflict within the structure of the system used by the user, or, when we use the server, some files can not be found for a long time do not use only remember individual details need to find the exact location of the file, or a lot of text file contents, which need to filter out the data needed, and so check these data is the actual use of regular expressions scene.
So, regular expressions use of the environment what is it? Environment in any place that we can use, for example, an internal Linux systems, grep these similar software, vim editor, python language, that is to say, these systems are capable of understanding the language or regular expressions, write a regular expression, it will know how to deal with the expression you wrote, this is the environment. It is clear that the document text editor for Windows does not support regular expressions, if you want to use regular expressions, will need an environment to be able to start.
Remember, regular expression processing of data is not a panacea, but no regular expressions, it is totally unacceptable.

Published 13 original articles · won praise 0 · Views 303

Guess you like

Origin blog.csdn.net/alwaysbefine/article/details/104781025