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'
You are familiar with the simplest regular expressions, that is, text strings. A specific string can be described by the text itself; regular expression patterns like foo can precisely match the input string foo. In this example, the following input
PHP downloads and replaces the address of the cost of the image in the collected content.
Get all the addresses in the string to an array we use the Preg_match_all function
Code to copy code as follows
$str = '
';
$pattern = "//];
Preg_match_all
PHP Regular Expression full manual, regular expression full manual
Full Manual of regular expressions for PHP
Objective
Regular expressions are cumbersome, but powerful, learned applications will give you an absolute sense of accomplishment in
Get all the addresses in the string to an array. We use the preg_match_all function. The code is as follows:Copy code $ Str = ' ';$ Pattern = "/ /";Preg_match_all ($ pattern, $ str, $ match); print_r ($ match );?>ResultArray([0] => Array
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
JS Regular Expression
// Check whether it is composed of digitsFunction isdigit (s){VaR patrn =/^ [0-9] {1, 20} $ /;If (! Patrn.exe C (s) return falseReturn true}
// Check Logon Name: You can enter only 5-20 strings starting with a letter, which can
Demo ContentUse the element attribute in the selector to get the specified element attribute or the element syntax that is worth it:[Properties]: All elements with the specified attributes are all matchedelement [Property]: matches the specified
: Nth-child and: Nth-of-type are CSS3 in the pseudo-class selector, its role is similar but not exactly the same, for unfamiliar people may not be very different, this article will introduce the difference between the two, in order to facilitate the
String pattern matching refers to locating a particular pattern string where it appears in a longer string.
A simple pattern matching algorithm
It is intuitive to write the following code to find out where the pattern string appears in
Sed is the more commonly used text editing Class command in Linux, with the rule progressive outputIts more commonly used usage is as follows:sed [OPTION] {SCRIPT} FILENAMEMain [OPTION]:-N: No longer displays content in the default mode space-I:
Stream Editor Simple usage of SED sed[options] sed cmds files Option –e Connect multiple Edit commands -f Specifies the SED script file name -N prevents input lines from being entered automatically Sed ' 4, $d ' test.in the first 4 lines of the
How to createvar reg=/\s/var reg=New RegExp ('\\s')//need to be escapedMatching principleAll letters and numbers are matched by literal meansSpecial symbols need to be escaped with a backslash (\) as a prefixMatch character[...] Match any of the
• Regular ExpressionsSEDawkRegular expressionsUse a single string to describe and match a series of strings that conform to a grammar rule.1. Features:(1) Flexibility, logic and functionality are very strong;(2) The complex control of strings can be
Python Regular Expression-findall#coding =utf-8import re ' # Gets the contents of the match ' ' P = re.compile (R ' \d+ ') print ' Find all the numbers ', P.findall (' One1two2three3four4 ') ' # Get matching Content-more complex examples of '
1.1 Shell some small summary1, 0 wide assertion 2, Print menu 3, getopts option Introduction 4, script query IP geolocation1.1.1 grep zero-width Assertions (0 wide assertion)It means taking out what you want and getting rid of things you don't care
This paper is familiar with the application of regular expressions by showing the structure of different regular expressions and the techniques used in practical applications.
Problem Description:
In this example you have to solve the following
The RegExp object provides a simple regular expression support feature.
Use of RegExp objects:
code is as follows
copy code
function Regexptest (PATRN, strng) Dim regEx, Match, Matches ' create a variable. The
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