Linuxshell programming ---- regular expressions

Source: Internet
Author: User
Linuxshell programming ---- regular expression 1 Regular Expression 1 regular expression is a string consisting of a string of characters and meta characters, RE (RugularExpression) 2. the characters in a regular expression are divided into two types of common characters and metacharacters:, 1, 2, and so on are common 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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.