Regular Expressions:
Why use regular Expressions: Help us quickly filter
Classification of regular Expressions:
Basic Regular Expressions
Extending regular Expressions
The difference between a regular and a wildcard:
Wildcard: function: Find Files
Regular: Action: Filtering in Files
Supported commands: The Three musketeers: Sed,grep,awk,python,java
Considerations for using Regular expressions:
1. Regular expressions are handled in a behavioral unit
2, note the Chinese symbol: The system does not recognize Chinese symbols
3, Grep/egrep add aliases:
Cat >>/etc/profile<<eof
Alias grep= ' grep--color=auto '
Alias egrep= ' Egrep--color=auto '
Eof
Source/etc/profile
Basic Regular expression:
^ 1th symbol, with what what begins ^m
$2nd symbol, to what end m$, also represents a blank line, or a space, you can try it with Cat-an
^$ 3rd symbol, empty line, no sign.
. A 4th symbol that represents any "one character"
\ 5th symbol, the escape character does not resolve the meaning of the special symbol, \ n equals the Enter key, \ t equals tab
* 6th symbol, indicating that the previous character has appeared 0 or more times in a row or more than 0 times
. * The 7th symbol, which represents any character, including a blank line, or a regular expression representing all or consecutive occurrences.
[] The 8th symbol, in brackets, in brackets, finds one character at a time.
[^] the 9th symbol, [^ACB], means to exclude a,b,c
Linux Basic Regular Expression