First, overview:The kernel of the core philosophy of Linux a piece of hardware is everything files, on the Linux system, regardless of hardware, software, configuration files and so on, all in the form of files presented. General file types are: Ordinary files, directory files, linked files, pipe files, socket files, character device files, block device files, and so on. And there are some text files in the
Linux regular expression-POSIX character class
POSIX standardizes the meanings of Regular Expression characters and operators. This standard defines two types of Regular Expressions: Basic Reg
nMeaning: If \{n,\} is a continuous n more than the previous RE character! Example: between G and G there are 2 to 3 o strings that exist, i.e. (GOOG) (Gooog)
grep-n ' go\{2,3\}g ' regular_express.txt
"The special byte of normal notation" is not the same as the "universal byte" that is normally entered in the command line, for example, the * in the million bytes means "0 ~ infinite number of bytes" meaning, but in the form
LS is the default sort.So:LS only supports wildcard characters and does not support regular, so simply using LS is not possible.Some regular filtering operations require a combination of regular-support commands such as grep, sed, or awk.Example: LS | grep "[0-9]$"Gets: Aaa1
stroke ending (appearing at the end of an expression);Grouping: Used to store matching characters in memory variables for later reference.\ (\): Group symbol\1: References the character to which the first grouping matchesExpand Regular Expressions: (EGREP,GREP-E)Character Match Meta character:. (dot): matches any one character;[]: Matches one of the characters w
Regular expressions consist of meta-characters and ordinary characters, with regular expressions and extended regular expressions.Regular expression metacharacters have the following categories: (grep)Character Match Meta character:. (dot): matches any one character;[]: Matc
First, grep
Keyword display color, plus line numberDmesg|grep-n--color=auto ' ETH '
Displays the first 2 lines and the last 3 lines of the line in which the keyword is located.Dmesg|grep-n-a3-b2--color=auto ' ETH '
Automatically add keywords to colorVim ~/.BASHRCAlias grep= '
stroke ending (appearing at the end of an expression);Grouping: Used to store matching characters in memory variables for later reference.\ (\): Group symbol\1: References the character to which the first grouping matchesExpand Regular Expressions: (EGREP,GREP-E)Character Match Meta character:. (dot): matches any one character;[]: Matches one of the characters w
Regular Expressions:Why use regular Expressions: Help us quickly filterClassification of regular Expressions:Basic Regular ExpressionsExtending regular ExpressionsThe difference between a regular and a wildcard:Wildcard: function:
B]}Location ^~/images/{# matches any query that has/images/start and stops the search. Any regular expression will not be tested.[Configuration C]}Location ~* \. (Gif|jpg|jpeg) $ {# matches any request that has a GIF, JPG, or JPEG end. However, all requests for the/images/directory will use Configuration C.[Configuration D]}Example Request:/-Configuration AConfiguration B/documents/document.html/images/1.g
Linux regular expression-selective operations and group operations
Selective operationThe vertical line (|) character is part of the metacharacters Extension Set and is used to specify the Union of regular expressions. If a row matches one of the regular expressions, it mat
Objective
Regular expression is cumbersome, but powerful, after the application of learning will let you in addition to improve efficiency, will give you a sense of absolute achievement. As long as the careful reading of these materials, coupled with the application of a certain reference, master regular expression is
Tagged with: Linux regular expression wildcard notepad++http://blog.csdn.net/pipisorry/article/details/24143801wildcard character (bash operation)There is also a very useful feature in the bash operation Environment, which is the wildcard character (wildcard)! It's even easier to process data with bash!Common wildcard charactersIn addition to wildcard characters,
corresponding closing parenthesis include the[2][3]He love his lover.She like her likerHW Love his LikerShe like her lovergrep ' \ (1..e\). *\1 '/etc/inittabgrep ' \ ([0-9]\). *\1$ 'grep ' B. h$ 'grep ' [[: space:]][[:d igit:]]$ 'grep "root\>" or "root\b"Regexp:regular EXPRESSIONPattern:Regular Expressions:Basic REGEXP: BasicsExtended REGEXP: ExtendedBasic
character position of the square brackets, such as []ab] or [-ab], if both characters exist at the same time, it will be] placed at the first character position--placed at the tail end, such as []ab-].such as [a-ba-z0-9!] Represents all uppercase and lowercase letters, numbers, and exclamation marks. [^ABC] represents all characters except A, B, and C. [Tt]om, can match Tom and Tom.] [-] matches all characters stored in the character's or-.7, "\{n,m\}" usageInterval
Fundamentals of the ten-year OPS series-LinuxZeng LinContact: [Email protected]Website: www.jplatformx.comCopyright: Please do not reprint the article without permission
First, IntroductionIn short, a regular expression is a symbolic notation used to recognize text patterns. To some extent, they are similar to the shell wildcard characters used when matching files and pathname, but they are more versatile
Linux wildcard and regular expression + notepad ++
Wildcard(Bash Operation)In the bash operating environment, there is also a very useful wildcard function, that is, the wildcard (wildcard )! It is easier to process data with bash!
Common wildcard characters
In addition to wildcards, special symbols in the bash Environment
Note:
1. In theory, try not to use th
preceding it may not exist, or there may be multiple;
'. *': denotes 0 or more arbitrary characters, including blank lines;
'+': Indicates that there is one or more of the characters immediately preceding it;
'?' : Indicates that the character immediately preceding it has 0 or one;
grep and SED can use '. ', ' * ' and '. * ', but cannot use ' + ' and '? ' Egrep and awk can all be used.This article is from the "fragrant fluttering lea
Linux wildcard and regular expression + notepad ++, wildcard notepad
Http://blog.csdn.net/pipisorry/article/details/24143801
Wildcard(Bash Operation)In the bash operating environment, there is also a very useful wildcard function, that is, the wildcard (wildcard )! It is easier to process data with bash!
Common wildcard characters
In addition to wildcards, spec
Linux shell script Regular Expression instance explanation, shell instance explanation
I. concepts and features of Regular Expressions:
A regular expression is a logical formula for string operations. It uses predefined character
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.