) { If (Long. tryparse (ID, out n) = false | n
{} If (address. indexof (ID. remove (2) =-1)
{} datetime time = new datetime ();
If (datetime. tryparse (birth, out time) = false)
{}}
# Whether region is int type /** // // whether it is int type //
// //
Public static bool isint (string source) { If (RegEx. match (source ). success) {{}}}
# region: Check whether the length of a string contains two Chinese characters in a limit. /** /// // check the strin
This program can be quickly implemented to our files using PHP compression class compressed into our thinking zip, or rar compression package, suffix name can be customized Oh, compression algorithm is from a foreign site copy.
First instantiate and then pass the argument. Two parameters. First an array of your file addresses. The second is the absolute address of the compressed package file that you want to save.
For example:
The
TopicFour sum of the numbersTo an array of integers containing n, find all the four tuples (a, B, C, D) that make and are the target of the given integer in S.Sample ExampleFor example, for a given array of integers s=[1, 0,-1, 0,-2, 2] and target=0. The four-tuple collection that meets the requirements is:(-1, 0, 0, 1)(-2,-1, 1, 2)(-2, 0, 0, 2)NoteFour tuples (A, B, C, D), need to meet a The answer cannot contain a duplicate of the four-tuple.SolvingHow to feel that the following program has b
wireframes
For (INT x = 0; x
For (INT y = 0; y
{
Double temp = f [x, y]. R-(F [x, y]. G + F [x, y]. B)/2.0;
If (temp> 0) g [x, y] = (byte) temp;
Else G [x, y] = 0;
}
// Display the extracted wiremap Image
Showimg ("g", G );
Int [] map_x = new int [w]; // projected value along the X axis
Int [] map_y = new int [H]; // The projection value along the Y axis.
For (INT x = 0; x
Map_x [x] = 0;
For (INT y = 0; y
Map_y [y] = 0;
// Projection along the X axis
For (INT x = 0; x
For (INT y = 0; y
Ma
ZipCode
if (Document.regform.u_zipcode.value = = "") {
Alert ("Hint: You must enter a ZIP code!") ");
Document.regform.u_zipcode.focus ();
return false;
}
if (document.regform.u_zipcode.value.length!=6) {
Alert ("Hint: Zip length not correct!") ");
Document.regform.u_zipcode.focus ();
return false;
}
bstring = "0123456789";
for (i = 0;
PHP + AJAX automatically completes the example: processing the zip code. After the customer enters a POSTCODE, zipcode. PHP receives it, extracts the corresponding data from the data table, and then returns it to the client in a certain format (separated by | ). After the customer enters a POSTCODE, zipcode. PHP receives it, extracts the corresponding data from the data table, and then returns it to the cli
Verification of mobile phone numbers (starting with 13 and starting with 158,159, 11 digits in total)Copy codeThe Code is as follows:Var re;Var ss = document. getElementById ('textbox3 '). value;Re =/^ (13 [0-9] {9}) | (15 [89] [0-9] {8}) $/If (re. test (ss )){Document. getElementById ('label3'). innerText = ""; // assign a value to the label using innerText}Else{Document. getElementById ('label3'). innerTe
// Check whether it is composed of digitsCopy codeThe Code is as follows:Function 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 contain numbers, "_", and ".".Copy codeThe Code is as follows:Function isRegisterUserName (s){Var patrn =
: This article describes php regular expression verification (email address, Url address, phone number, and zip code). If you are interested in PHP tutorials, refer to it. The content to be verified in this example is as follows: email address, Url address, phone number, and zip code. the verification method is for you
Php detects common code classes (such as zip and rar) of file types through the file header ). Sometimes this is not perfect. Some people may store some files, but they modify the extension to make it within our file type. It cannot be displayed during a single access (sometimes we are not doing well. Some people may store some files, but they modify the extension to make it within our file type. It cannot
Php Regular Expression verification (email address, Url address, phone number, zip code), regular expression url
Content to be verified in this example:Email Address, Url address, phone number, zip codeThe verification method is shared with you for your reference. The details are as follows:
1. Email address verification
2. URL address verification
3. Phone num
the same time: (^ (\ d {3, 4 }-)? \ D {7, 8}) $ | (13 [0-9] {9 })Extract the network link in the information: (h | H) (r | R) (e | E) (f | F) * = * ('| ")? (\ W | \/| \.) + ('| "| * |> )?Email Address in the extracted information: \ w + ([-+.] \ w +) * @ \ w + ([-.] \ w + )*\. \ w + ([-.] \ w + )*Extract the image link in the information: (s | S) (r | R) (c | C) * = * ('| ")? (\ W | \/| \.) + ('| "| * |> )?Extract the IP address in the information: (
expression: ^ \ s * \ d + \.
This method is the same as above.
Method 2: If your development tool is not easy to use, you can download and use thisRegular Expression Testing Tool
Running isCommands-> run
I hope this article will solve the problem of having a line number in the Code copied from the Internet. I hope you will like it and pay more attention to the small series of articles.
Articles you may be interested in:
Detailed steps for addin
Http://www.cnblogs.com/wuhuisheng/archive/2011/03/23/1992652.html
The main code for phone number verification is as follows:
Public bool istelephone (string str_telephone)
{
Return System. Text. regularexpressions. RegEx. ismatch (str_telephone, @ "^ (\ D {3, 4 }-)? \ D {6, 8} $ ");
}
The main code used to verify the mobile phone number is as follows:
Public boo
png file is 4 bytes (the number of bytes marked by the header needs to be determined by yourself), corresponding to: 89504E47
If you are not familiar with the pack unpack of php, you can view:
Php park, unpark, ord function usage (binary stream interface application instance)
Call instance:
The code is as follows:
$ Filename = "d:/1.png ";
Echo $ filename, "\ t", cFileTypeCheck: getFileType ($ filename)
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.