Some notes about regular expressions in Linux: linux Regular Expressions
We usually have no scrubs about using regular expressions in Linux, unlike windows.
But today I found that we should pay attention to the following special characters:
Point :.
Slash :/
Asterisk :*
The escape \ must be added before the identification \.
In addition, if the recognized group is at the end of the string, $! Must be added to the brackets of the group!
A small problem with linux Regular Expressions
Bbs.chinaunix.net/thread-218853-1-1.html very NB interpretation. Let's see.
Linux Regular Expressions
Enclose the grep content with double quotation marks or single quotation marks,
For example, ls-la | grep "m * x"
Ls-la | grep "m1 \ {1, 3 \} x"
Otherwise, bash will replace *,., and other symbols in its own way (replace file wildcards. In this way, what actually passes in grep is not the m * x that you see, but the content that has been replaced by bash.