Before the beginning of this chapter, I will introduce an example to illustrate whether this kind of incomplete abnormal optimization is reasonable or unreasonable...
The Optimization of the direct amount of strings in c # is very thorough... we
I. character classes
Concept:Put the Individual Direct character in square brackets to form a character class ).
Note:Red indicates that it is not particularly clear
[...] -- Indicates that any character in the character class meets
[^...] --
Regular Expression set for verifying numbersVerification number: ^ [0-9] * $Verify the n-digit number: ^ \ d {n} $Verify at least n digits: ^ \ d {n,} $Verify m-n digits: ^ \ d {m, n} $Verify the number starting with zero or zero: ^ (0 | [1-9] [0-9]
1. Only numeric code can be entered in the text box (decimal point cannot be entered)2. Only numbers can be entered, and decimal points can be entered.3. Number and decimal point method 24. Only letters and Chinese characters can be entered5. Only
The following three methods are used:
1.(...)
Grouping. Group items into a single unit that can be used*,+,?,|, And so on. Also remember the characters that match this group for use with later references.
2.(? :...)
Grouping only. Group items into a
test whether the octal digit is a valid date String: Regex: [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Use ". * "matches any character. If you want to include all the articles similar to" " simplified to "" to search for the string "" and replace it with ".In search and replace(sr32.exe), use "* []" to match. For example, set all "style =" boder: 1px
For example, I want to display an image of the content I added on the left side of the page template (separated by two cells), and the text content of the article on the right, that's it. If we use the tag provided by fengxun, it is impossible to
I. Clear the Javsscript code in the content Copy codeThe Code is as follows:Function ClearJSCode (originCode)Dim regSet reg = New RegExpReg. Pattern = ""Reg. IgnoreCase = TrueReg. Global = TrueClearJSCode = reg. Replace (originCode ,"")End
A regular expression (regular expression) describes a string matching pattern, it can be used to check whether a string contains a seed string, replace matched substrings, or retrieve substrings that meet certain conditions from a string. A regular
In Javascript, there are two ways to use regular expressions. One is to create an instance of a regular expression, but to use the regular expression related methods in the String object.Regular Expression objectTwo creation methodsVar my_regex =/[a-
Preg_replaceParses and replaces string comparison.Syntax: mixed preg_replace (mixed pattern, mixed replacement, mixed subject );Returned value: hybrid dataFunction Type: Data ProcessingDescriptionThis function uses the pattern Rule to parse and
Function ubb ($ Text ){$ Text = htmlspecialchars ($ Text );$ Text = ereg_replace ("\ r \ n", "", $ Text );$ Text = ereg_replace ("\ r", "", $ Text );$ Text = nl2br ($ Text );$ Text = preg_replace ("// \ t/is", "", $ Text );$ Text = preg_replace ("/\
Regular ExpressionIf you have never used a regular expression, you may not be familiar with this term or concept. However, they are not as novel as you think.Remember how to find files on the hard disk. Are you sure you want to use? And * characters
Many may have headaches for regular expressions. Today, I want to use the expressions that ordinary people can understand with my understanding and some online articles. Share your learning experience with you.The beginning is still worth mentioning
I. Reader GuideReader guide helps you understand the synopsis of this article. Otherwise, you may not understand that this article is not suitable for you and may cause visual pollution.If you are writing a program using ASP, or you are writing
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