After applying the regular expression to the URL shown above, the Child match contains the following content:A [1] contains "HTTP"A [2] contains "msdn.microsoft.com"A [3] contains ": 80"A [4] contains "/scripting/default.htm"(You can also use Regexp.
syntax Rules: Location [=|~|~*|^~]/uri/{...}= start with exact match^~ begins by indicating that the URI begins with a regular string and is understood to match the URL path. Nginx does not encode the URL, so the request is/STATIC/20%/AA, which can
An example:Location =/{# exact Match/, cannot carry any string after hostname [configuration A]}location/{# because all the addresses start with/, so this rule will match all requests# but regular and longest strings match [configuration B]}location/
Exec: Regular Expression is performed on the string, and the matching result is returned. array [0] is the original string, and array [I] is the position that matches the entire string to be searched.
Test: test whether a string contains a matching
All the methods of JS string Formcharcode:String.formcharcode (";>>>>>>") "7"The Unicode code returns the corresponding string. CharAt:var str= "Hello World"; Str.charat (0);>>>>> "H"; returns the corresponding string by index, the range is
URL rewriting refers to a rule, such as common pseudo-static, 301 redirection, browser orientation, and so on, by configuring the Conf file to have a certain state in the URL of the site.Rewrite syntaxWrite in the block of the configuration file
Regular ExpressionsApplication Scenarios
Search for a particular pattern string, replace cut, etc.
Validation of formats such as mailbox formats, URLs, etc.
Crawler projects to extract specific valid content
Configuration files
EXEC: Regular processing of string and return of matching result. Array[0] is the original string, Array[i] to match the position in the entire searched string.
Test: Tests whether string contains a matching result, contains return true, and does
In JavaScript, there are two ways to use regular methods, one is to create an instance of a regular expression, but rather to use a regular expression in a string object to relate the method.
Regular Expression Object
Two methods of creating
var
In JavaScript, there are two ways to use regular methods, one is to create an instance of a regular expression, but rather to use a regular expression in a string object to relate the method.
First, there are 2 ways to create regular expressions:
background
The URI configured in the location in a project is variable and needs to be matched by a regular item. Also, by the way, the configuration problem in location is sorted out. Detailed:
Mode
meaning
I. New. NET Class Library project
Create a class library project named Mssqlregexextend
Create a class named Regexextend
Copy the following code into the class[CSharp]View PlainCopy
Using System.Text.RegularExpressions;
Syntax rules: location [=|~|~*|^~]/uri/{...}= indicates an exact match, which is the highest priority^~ means that the URI begins with a regular string and is understood to match the URL path. Nginx does not encode the URL, so the request is/STATIC/2
Brief introduction
Regular Expressions (regular expression) are patterns that can match text fragments. The simplest regular expression is an ordinary string that can match itself. For example, the regular expression ' hello ' can match the string '
Syntax rules: location [=|~|~*|^~]/uri/{...} = start means exact match ^~ begins with a URI that begins with a regular string and is understood to match the URL path. Nginx does not encode the URL, so the request is/STATIC/20%/AA, which can be
Syntax rules: location [=|~|~*|^~]/uri/{...}= Start with exact match^~ begins by indicating that the URI begins with a regular string and is understood to match the URL path. Nginx does not encode the URL, so the request is/STATIC/20%/AA, which can
Syntax rules: location [=|~|~*|^~]/uri/{...}= Start with exact match^~ begins by indicating that the URI begins with a regular string and is understood to match the URL path. Nginx does not encode the URL, so the request is/STATIC/20%/AA, which can
Location expression type~ indicates that a regular match is performed, case-sensitive~* indicates that a regular match is performed, is case-insensitive^~ indicates normal character matching. Match with prefix. If the match succeeds, the other
Location expression type~ indicates that a regular match is performed, case-sensitive~* indicates that a regular match is performed, is case-insensitive^~ indicates normal character matching. Match with prefix. If the match succeeds, the other
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.