Regular expressions are not unique to Linux systems, but regular expressions are a widely used representation in Linux systems. This article will give a brief introduction to the use of regular expressions in Linux systems.
I. Regular Expressions
In computer science, regular expressions are used to describe or match a series of strings that conform to a syntactic rule; in a text editor or some tool In a bash environment, for example, regular expressions are often used to retrieve textual content that conforms to a pattern. In Linux, regular expressions are patterns written by a type of character. Filtering the required strings in the bash environment by implementing a defined pattern.
A regular expression consists of a series of ordinary characters and some metacharacters. Ordinary characters mainly include uppercase and lowercase letters and numbers. Metacharacters have a special meaning. It does not represent the meaning of the characters themselves but is used for additional functional descriptions. Regular expressions have basic regular expressions and extended regular expressions. Below I will list some commonly used metacharacters commonly used in Linux, and use related examples to explain:
1. Basic regularization Expressions
2. Extending regular expressions
The following mainly lists some metacharacters that differ from basic regular expressions.
3. There are other things in Linux. Escape characters, but here are just a few listings and explanations for commonly used ones. Interested friends can view the help system provided in the man documentation through “man 7 regex”.
Second, the use of grep command
Let me introduce how to use the grep command to use the regular expression for the corresponding pattern matching. First let me introduce the basic use of the grep command.
grep (Global Search Regular Expression and Printing), which means comprehensive search for regular expressions and printing. It is a powerful text search tool that can search for text using regular expressions and print matching lines. come out. There are three types of grep, including grep, egrep, and fgrep.
Respectively:
The above is the use of regular expressions in Linux. Of course, the introduction of this article is general, but basically covers all the uses of regular expressions in Linux. .
Usually Linux boot Linux ISO image must be burned to CD or boot from USB drive, the
Under the Linux system, the font of the Chrome browser can be rendered, which makes
Fedora is a kind of Linux system, most of the operations also need commands to complete, there are u
In Linux system operation, sometimes the system fails to start because the fstab fi
Linux svn automatic update error report post-commit hook failed?
Linux system Vsftpd server virtual user and passive mode configuration method
What is the use of the Linux system pppsetup command?
CentOS automatically starts the desktop service after booting
How to use the find command in Linux to periodically transfer logs
Two classifications of Linux system commands
Linux cancels the SSH login password
How Linux uses the at command to perform tasks
RedHat software source prompt Unable to read consumer identity?
Linux operation and maintenance needs to master the command summary
How to effectively optimize for Windows XP
Have to know the Windows2003 system optimization cheats
What should I do if the app store upgrades win8.1 and cannot complete the update?
How to solve the problem of Win10 personalization can not be opened
Win7 system to play violent motorcycle 2002 appeared flower screen how to do
Why can't Vista download software access the Installer?
How does the Win7 system pretend to be an IP address?
Making Win8 Win To Go Workspace
Win10 switches users to default browser manufacturing "trouble"