Practical Regular Expression learning notes

// Match the text, which is useful occasionally, but be careful when the character contains \ E$ Str = '[a-z]';$ Str = preg_replace ('/\ G [a-z] \ E/', '', $ str );Echo $ str; // print empty, all replaced, probably preg_quote Function// Name the

Detailed expression 4

For the newly added objects that are not regular expressions, see the corresponding Javascript Object Attributes.$ _ Attribute reference input$ * Attribute reference multiline$ & Attribute reference lastMatch$ + For details about attributes, refer

See a JS regular question.

Post it to encourage everyone.First read a piece of code,Why does the second test return false? Is it strange.The reasons are as follows:Test is actually the same as the exec method, but the return value is different. Test returns true or false (if

Several Basic concepts of Regular Expressions

I often see regular expressions, but I only talk about methods, but I seldom talk about the following basic concepts:1. Greedy: + ,*,?, {M, n} and so on are greedy by default, that is, as many matches as possible, also called the maximum matchIf ?,

Global replacement with JavaScript to solve the problem of special symbols such as $ [

Thanks to the regular expression provided by the waves. For the original post, see:Http://www.iecn.net/bbs/view/106503.htmlBecause you want to replace a template, the variables in the template are named in the format of $ {MyName. When performing

Regular Expression Verification

 ######################## Author: Yu Lang copyright ownership. Let's talk about it in a reverse version ## QQ: 270499458 ########################Recently, a few friends who have just learned Regular Expressions asked me how to use it in asp. haha.

Automatically identifies HTML tags to replace connections

Copy codeThe Code is as follows:Function SenFe_UbbCode (sContent)Dim TempRegSet TempReg = New RegExpWith TempReg. IgnoreCase = True. Global = True'Automatically identifies the URLIf InStr (Lcase (sContent), "http: //")> 0 Then. Pattern = "(^ | [^

Regular Expressions limit text input

lowercase English: uppercase English: Any number: limited to 2 decimal places: for example, Date: for example, 2002-9-29 any Chinese: English: range: a, B, c, d, e Chinese: scope: 80 or 90, [Ctrl + A select all Note: If you

Remove html from content

Option ExplicitFunction stripHTML (strtext)Dim arysplit, I, j, strOutputArysplit = split (strtext, "If len (arysplit (0)> 0 then j = 1 else j = 0For I = j to ubound (arysplit)If instr (arysplit (I), ">") thenArysplit (I) = mid (arysplit (I), instr

Discussion on regular expressions in tables (tables)

I have read a lot of UBB code, including JavaScript, ASP, JSP, and I have never found the UBB of a table. Although I can directly use the HTML mode to implement the same table function, however, for some open sites, the open HTML mode is not

Review the learning notes of JavaScript Regular Expression js

1. Create a regular expressionCreating a regular expression is similar to creating a string. Creating a regular expression provides two Methods: Using the new operator and using the literal method.Copy codeThe Code is as follows:Var dog = new RegExp

Exec, test, match, search, replace, and split usage in js

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

Grep Usage Details grep and Regular Expressions

A regular expression is only a representation. As long as the tool supports this representation, the tool can process the string of a regular expression. Vim, grep, awk, and sed both support regular expressions, and they seem powerful because they

How to construct complex Regular Expressions

This article was originally titled how to construct a complex regular expression. However, when I felt a little ambiguous, I felt that the regular expression was very simple. I was teaching people how to make things bigger. On the contrary, I mean

Regular Expression that matches 5 to 10 digits without repeated numbers

You can use a regular expression like \ d {5, 10} for numbers ranging from 5 to 10.I thought about the number of 5 to 10 digits that were not repeated, so I had to check the internet.The RegexBuddy test is successful.Copy codeThe Code is as follows:

Use regular expressions to search for html tags with id attributes in html

For example:String 123213 21314423 Does not match ...... contentThis example can be used.] +? Id = [^>] +?>. *? MatchThe previous php example:Copy codeThe Code is as follows:$ Str = ' 123213 213123 ';$ Search = '# ] +? Id = [^>] +?>. *? #

Summary of special characters to be escaped in Regular Expressions

If you want to find a file with * in the file name, you need to escape *, that is, add a \ before it \. Ls \ *. txt. Regular expressions have the following special characters. Escape Special characters Description

Index attributes (RegExp object) of js Regular Expressions)

Function: the value of index is the same as that returned by search. Whether or not appropriate content is matched, if appropriate content is found, index indicates the starting position of the actual character of the matched content. If no content

Regular Expression to determine the carrier js Code modified

Function: determines the carrier of the entered number.This function is implemented according to the following standards:Mobile: 134-139 151 188China Unicom: 130-132 156Telecom: 133 189 155No data information will be displayed for number queries

Regular Expression sorting for JQuery numeric type verification

Copy codeThe Code is as follows:Var regexEnum ={Intege: "^ -? [1-9] // d * $ ", // integerIntege1: "^ [1-9] // d * $", // positive integerIntege2: "^-[1-9] // d * $", // negative integerNum: "^ ([+-]?) // D *//.? // D + $ ", // numberNum1: "^ ([1-9]

Total Pages: 10629 1 .... 5910 5911 5912 5913 5914 .... 10629 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.