PrefaceRegular Expressions (a regular expression, which is called "re" below) has always been a secret zone for younger brother. As you can see, some of the network's big data has solved some text problems simply by using "re, the younger brother
Interpretation of all symbols in a regular expression
Character
Description
/
Mark the next character as a special character, a literal character, or a backward reference, or an octal escape character. For example, 'n'
The Nginx access log format is as follows: The code is as follows:Copy code # The default nginx log format $ remote_addr-$ remote_user [$ time_local] "$ request" $ status $ body_bytes_sent "$ http_referer" "$ http_user_agent" "$ http_x_forwarded_
1. Basic knowledge of regular expressionsMeaning: string mode consisting of common characters (a-z) and special charactersFunction: validity verification.Replace text.Extract a substring from a string.Classification: POSIX and PerlPOSIX is easier to
From: http://www.yesky.com/imagesnew/software/vbscript/html/jsgrpRegExpSyntax.htm
Regular expression syntax
A regular expression is composed of common characters (such as characters A to Z) and special characters (calledMetacharacters. This mode
What is awk?You may be familiar with Unix, but you may be unfamiliar with awk, which is not surprising. Indeed, compared with its excellent functions, awk is far from its proper popularity. What is awk? Unlike most other UNIX commands, we cannot
Problem Introduction1. To verify that the password length entered by the user satisfies the length of the 6~18 bit^. {6,18}$2. Fixed phones are 0 area code-eight-digit format, then the regular expression matches the following^0\\d{2}\-?\\d{8}$3.
Metacharacters: Match character, match position, match number, match pattern.List of common meta characters . Match any character other than line break\b Match the beginning or end of a word\d Matching numbers\w matches letters,
1. Directory Management1.1, the directory structure of Linux.: Current Directory.. : Top level Directory/: Root directory/bin: binary, executable commands/boot: Boot, the file that the operating system uses to boot the system, kernel, grub/dev:
Regular | repeat
Character classes represented by regular expression syntax
Character class
Matching characters
Example
\d
Numbers from the 0~9
\d\d can match 72, but cannot match 7a or A7
Why use regular expressionsManipulating strings is one of the most important features in almost every programming language. It is very simple to understand, because the human information is transmitted mainly by the text, that is, the string, but so
SymbolA regular expression consists of a set of ordinary characters and metacharacters.Ordinary characters include numbers and uppercase and lowercase letters.Meta-character Description\ marks the next character as a special character, or a literal
Regular expression metacharacters and normal characters:According to regular expression syntax rules, the matching pattern of regular expressions is composed of a series of characters.
I. Ordinary characters:
Most characters can only describe
character
Notes
Description
\
Escape or other
Marks the next character as a special character, or a literal character, or a backward reference, or an octal escape. For example, ' n ' matches the character "n". ' \ n '
linux-basic-grep and regular expressionsText Lookup command:Grep,egrep,fgerpgrep: Searches text based on patterns and displays lines of text that conform to the patternPattern: The matching criteria for the combination of meta-characters of the
1.ctags
The Ctags command with the VIM editor can help programmers easily view the source code, using the method:
(1) Executing ctags-r * Recursively to establish source code information base under the source code top-level directory;
(2) Vim-t
Differences from Perl PCRE function PCRE Patterns PHP manual
Schema Syntax
(No version information available, might only being in SVN)
Schema syntax-syntax explanation for Perl compatible regular expressions
The PCRE library is a set of functions
So far, many programming languages and tools contain support for regular expressions, and C # is no exception, and the C # base Class library contains a namespace (System.Text.RegularExpressions) and a series of classes that can give full play to
Use Python to parse Nginx access logs, split them according to the Nginx log format, and store them in the MySQL database.One, Nginx access log format is as follows:
Copy Code code as follows:
$remote _addr-$remote _user [$time _local]
There are two sets of regular expression libraries in PHP that are similar in functionality, but have slightly different execution efficiencies:
A set is provided by the Pcre (Perl compatible Regular Expression) library. A function named after a
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.