Linux shell programming ---- Regular Expression 1 Regular Expression 1 Regular Expression is a string consisting of a string of characters and meta characters, RE (Rugular Expression) 2. The characters in a regular expression are divided into two types of common characters and metacharacters: a, 1, 2, and so on *,., [], and so on are the meanings and symbols of the metacharacters in the metacharacters 3 basic regular expressions * matching the common character before 0 or more. match any character ^ matches the beginning of a line or the end of a non-$ matches the end of a line [] matches the character set \ Escape Character 4. What is the extended symbol meaning of the regular expression? Match 0 or 1 common character before it + match 1 or more common characters before it () match the character set or use it in expr | match an optional set of characters 2 bash shell with the wildcard 1 * symbol does not represent matching one or more of its previous common characters, it indicates matching a common character of any length 2? The symbol no longer indicates that it matches 0 or 1 common character before it, but now it indicates that it matches any common character 3 ^ no longer indicates that it matches the first line, the result is 3 GREP 1 global search regular expression (RE) and print out the line, A powerful text search tool that comprehensively searches Regular Expressions and prints rows 2 grep, it can use regular expressions to search text and print out the basic usage of the 3 grep command grep option mode file 4 grep command important options and their meanings option meaning-c only outputs the number of matched rows -I ignore case-h when searching for multiple files, the file name is not displayed.-l only lists matching file names, instead of listing specific matched rows-n to list all matched rows, and displaying row number-v to display rows that do not contain matched text