JavaScript Regular Expressions1. Using the JS regular expression, first of all to understand the JS regular expressions commonly used symbols, such as:
/.../
Represents the beginning and end of a pattern
^
Match
JavaScript regular expression syntax and Examples
JavaScript Regular Expression
1. To use a JS regular expression, you must first understand the common symbols of the JS regular expression, such:
/... /
Indicates the start and end of a
1. Only numbers and English can be entered:
2. Only numbers can be entered:
3. Only the full angle can be entered:
4. Only Chinese characters are entered:
--------------------------------------------------------------------------------
Verify
/*****************************************************************Form validation Tool Class (LINJQ)*****************************************************************//*** Determine if integer num equals 0** @param num* @return* @author
Common JS Summary:function obj$ (ID) Gets the object based on the IDfunction val$ (ID) Gets the value of the object based on the IDfunction Trim (str) remove left and right spacesfunction LTrim (str) Remove left spacefunction RTrim (str) Delete
DateTime a = DateTime.Parse ("2010-1-9 8:00:00");DateTime B = DateTime.Parse ("2010-1-13 13:41:52");return a > B;-----------------------------------------------------Date1=new Date ("2002/1/1")Date2=new Date ("2002/1/2")Alert (Date.parse (date1)
Purpose: Verify the format of the IP addressInput: Strip:ip AddressReturns: False if True is returned by validation;*/function IsIP (StrIP) {if (IsNull (StrIP)) return false;var re=/^ (\d+) \. (\d+) \. (\d+) \. (\d+) $/g//matching regular
Good JS verification ~~~~~~~~~~~~~~~~~~~~~~~~~Purpose: Verify the format of the IP addressInput: Strip:ip AddressReturns: False if True is returned by validation;*/function IsIP (StrIP) {if (IsNull (StrIP)) return false;var re=/^ (\d+) \. (\d+) \. (\
I. ActionBar:
The ActionBar replaces the traditional title bar at the top of the device screen. It displays the application icon and activity name. You can also add action items to the ActionBar. action items are shortcuts for operations that are
JS validation function of the call method and note:
1. Set the form onsubmit= "return test ()", with Submit.
2.//When the mouse is pressed, call function validation directly
3.//Pass in its own value for verification, test (this)//incoming object
This article describes the detailed summary of the js verification form, which has some reference value and needs, you can refer to the good JS verification ~~~~~~~~~~~~~~~~~~~~~~~~~
Purpose: Verify the IP address format.
Input: strIP: IP
Make the following Javascript file and call it on any page./* = =* 1. var_to_obj --------- convert a variable to an object* 2. is_greater --------- determine whether the number is greater than a certain number* 3. is_less ---------- determine
/*
-------------------------------------------------------------------------------
File name: Check.js
Description: JavaScript script, used to check the input data of the Web page submission Form
Version: 1.0
*/
/*
Purpose: Verify the format of IP
/*
To determine if the specified content is empty, or to eject the warning box if blank
*/
Function IsEmpty (thevalue, STRMSG) {
if (thevalue== "") {
Alert (strmsg+ "cannot be empty!");
return true;
}
return false;
}
/*
Chinese judgment function,
The first few chapters we analyzed the FM module several main class file, today to analyze is:Fmtransceiver.java //Some project name is Fmradioservice.javapublic class fmtransceiver{ /* Primary FM states: * FM would be is in one of the 4 states at
JavaScript: Common JavaScript detection scripts. Javascript tutorial *
-------------------------------------------------------------------------------
File Name: check. js
Note: JavaScript scripts are used to check the input data of the webpage
JS verification function call method and note:
1. Set onsubmit = "return test ()" for the form and submit it with .
2. // call function verification directly when you press the mouse
3. // pass in your own value for verification, test (this) //
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.