There are many methods added to string. prototype, but they are roughly divided into the following categories:
Category
Method Name
Original capability enhancement
Strip | include | startswith | endswith | empty | Blank
JavaScript Regular Expressions (notes) and javascript Regular Expressions
1. What is a regular expression?
// The regular expression is an object that describes the character pattern;// JS defines the RegExp class to indicate a regular expression;//
In the reference learning the VI and Vim editor when found that the ex editors as the parent class VI, for our in-depth understanding of VI and VI clones of the past life has great help, it is necessary to separate a document to introduce some
$ String = "13826589549 ";
$ Pattern = "/(\ D {3}) \ D (\ D {2 })/";
$ Replacement = "\ $1 ***** \ $3 ";
Print preg_replace ($ pattern, $ replacement, $ string );
Output result: 138 **** 9549
The matching result is what I want, but the
What is a simple regular expression? Reply to score! The telephone number field (telvarchar type) stores three numbers and ends with a semicolon, for example, 0510-12323475,0781-26354589,021-25698746 (three numbers are stored simultaneously) 0521-256
Recently in the mobile phone page, encountered the problem of digital input keyboard, the previous practice is only one-size-fits-all use type= "tel", but always think nine Gongge phone number on the keyboard of the English letter is too much of a
$ Str = 'sdfasfs12333ddd12233 ';
Preg_match ('/\ d/si', $ str, $ arr); // you can specify three consecutive numbers.
Echo ' ';
Print_r ($ arr );
Echo ' ';
1. This function only matches the first value.
2. $ Arr [0] stores the result.
The input box filters non-numeric js Code, and the input box js Code
HTML:Copy codeThe Code is as follows:
JS:
Window. onload = function (e) {var text = document. getElementById ("only"), pattern =/\ d/, // pattern matches the alphanumeric key
Special character Matching1 var pattern=/\[/; // use the \ symbol to escape special characters in the regular to match 2 var str= ' ['; 3 alert (pattern.test (str));Line break mode1 var pattern=/\d+/g; // Unqualified first match 2 var str= '
[1] definition : Regular, also called a rule or pattern, is a powerful string-matching tool that is an object in JavaScript
[2] features :
[2.1] Greed, matching the longest[2.2] lazy, do not set/g, then only match the 1th
[3] Two types of wording:
The syntax of regular expressions is convenient for program processing, but is not actually a regular expression that can be used directly for filtering. Common regular expression pattern for filtering white-space characters
function Isnumber
Html:
Copy Code code as follows:
Js:
Window.onload=function (e) {var Text=document.getelementbyid ("only"), Pattern=/\d/,//pattern match the number key on the letter pattern2=/(9[ 6-9]) | (10[0-5]) |3 (7|9)/,//pattern2
What is a regular expression
A regular expression (regular expression) is an object that describes a character pattern;JS defines the RegExp class to represent regular expressions;Both string and RegExp define powerful pattern matching and text
This article describes the PHP implementation of the replacement of mobile phone number between the number of * and hidden IP last few methods. Share to everyone for your reference, specific as follows:
$string = "13826589549";
$pattern = "/(
The RegExp type of javascript learning notes. For details about js learning, refer to 1. Matching pattern mark:
G ------ indicates the global mode, instead of immediately ending when the first match is found to be successful.
I ------- indicates the
The following summarizes several methods of verifying whether the date entered by the user is correct using php. If you need it, refer to it.
The checkdate () function verifies a greaguri date.
Example
The Code is as follows:
Copy code
the enhanced version of ol with the DL1, OL's Start property and reversed property1. You can define the start value of a label by using the Start property.2. You can use the reversed property to reverse the numbering.
ordered list a
The regular expression defines the pattern of the string.Regular expressions can be used to search, edit, or manipulate text.Regular expressions are not limited to a single language, but have subtle differences in each language.Java regular
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.