Regular expressions for Linux learning

Source: Internet
Author: User
In Linux, regular expressions, regular expressions, and string expressions are classified into basic regular expressions and extended regular expressions based on different levels of rigor. Next, let's look at basic regular expressions: Some frequently used symbols [; alnum:] indicates 0-9a-zA-Z [: alpha:] indicates -...
In Linux, regular expressions, regular expressions, and string expressions are classified into basic regular expressions and extended regular expressions based on different levels of rigor. Next, let's look at basic regular expressions: Some frequently used symbols [; alnum:] represents 0-9 a-z A-Z [: alpha:] represents a-z A-Z [: lower:] represents a-z [: upper:] represents A-Z [: digit:] it indicates 0-9 www.2cto.com. before learning regular expressions, it is necessary to know grep usage grep [-A] [-B] [-- color = auto] 'query string'. filenameA can be followed by numbers., in addition to listing this row, a number can be added after Column B in the n Industry. this is the meaning of before, except for listing and modifying rows, the previous n industries are listed in the English section for a regular expression exercise: "Open Source" is a good mechanic to develop programs. app Le is my favorite food. football game is not use feet only. this dress doesn' t fit me. however, this dress is about $3183 dollars. ^ MGNU is free air not free beer. ^ MHer hair is very beauty. ^ MI can't finish the test. ^ MOh! The soup taste good. ^ Mmotorcycle is cheap than car. This window is clear. the symbol '*' is represented as start. Oh! My god! Www.2cto.com The gd software is a library for drafting programs. ^ MYou are the best is mean you are the no. 1.The world Is the same with "gglad". I like dog. google is the best tools for search keyword. goooooogle yes! Go! Go! Let's go. # I am VBird (downloaded from laruence's private kitchen). There are 22 lines in this file, and the bottom line is blank. now let's start a case study. Case 1: Find the lines containing

Case 2: Search for rows without
Case 3: rows containing the 'or''
Case 4: Find the rows that contain test and taste, and carefully analyze the requirements. test and taste both contain t s, and t www.2cto.com. Case 5: Find the rows that are not g before oo.
Case 6: Search for rows containing numbers
Case 7: Search for rows starting with lowercase letters

Case 8: The end of the trip is the decimal point.
Case 10: Search for blank rows in the expression. represents any character * indicates that the previous character has been repeated for 0 or multiple times. * This means that any character is repeated for any number of times, including 0 explanations. The last Knowledge Point is limited to the range of consecutive characters {} case 11: Search for rows with 2 to 5 consecutive zeros: www.2cto.com
Basic regular expression character ^ word: string to be queried at the beginning of the row wrod $ string to be queried at the end of the row * repeat 0 to infinite number of the first character [list] from the character set and find the desired character [^ list] from the character set find out the string range \ {m, n \} The author yuanzeyao2008 from m to n consecutive times
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.