A few days ago, when I looked at some documents, I saw a representation of the operation of a character, that is, the formal notation, look at the encyclopedia of the formal representation of the outline has the following paragraph of the description of the text.
Regular Expressions (English: Regular expression, regex, or RegExp, abbreviated as RE), also translated as formal notation, conventional notation, in computer science, refers to a series of words that describe or match a set of syntactic rules. A single string of strings. In many text editors or other tools, regular expressions are often used to retrieve and/or replace text content that conforms to a pattern. Many programming languages support the use of regular expressions for string manipulation.
Obviously, what we call formal notation is a way of representing a character, and in another book I see some of the relevant statements, that is, a summary of common formal representations.
grep, for example, is the simplest string extraction program, which, based on this, records the next few special symbols to know:
[: Alnum:] Represents the English case, i.e. 0-9 A-Z
[: Alpha:] represents any English character and data, i.e. A-Z a-Z
[: Upper:] represents uppercase characters
[: Lower:] represents lowercase characters
[:d Igit:] Represents a number
[: Xdigit:] represents 16 binary numeric type, so includes 0-9 a-f a-f
When grep queries a string in the data, it is extracted with the positive behavior unit, Grep-n-ax-by--color=auto ' string ' file n shows the line number,-ax represents the last X line that will look for the character, and-by represents the first Y line showing the character to be looked up. ,--color=auto indicates that the keyword part is color-coded, followed by the string to be searched and the file to be found.
It is important to note that in the usual case, under our user directory. BASHRC has been added to--color=auto so often, when we use grep, we don't have to add a limit to this sentence.
There is also a symbol ^ that the symbol is different within the character set symbol [], which represents the reverse selection within [], and beyond [] represents the meaning of positioning in the first line, which we need to pay a little attention to below.
Attach two simple examples for a quicker understanding of the aftertaste:
Grep-n ' ^the ' file finds the line that begins with the.
Grep-n ' ^$ ' file to find empty lines in the files.
Regular notation for Linux under Common records