JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«
JavaScriptÑéÖ¤ÕýÔò±í´ïʽ´óÈ«,ËѼ¯×îÈ«µÄJavaScriptÑéÖ¤ÕýÔò±í´ïʽ,¿ªÊ¼²é¿´°É£¬ÕâÀïµÄ¶¼ÊÇÕýÔò±í´ïʽµÄÀý×Ó£¬¾ßÌåºÍº¯Êý½áºÏµÄʹÓ÷½·¨£¬»¹Çë²é¿´ÏÂƪÎÄÕ¡¶JavaScriptʹÓÃÕýÔò±í´ïʽ½øÐÐÑéÖ¤¡·
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º [u4e00-u9fa5]
ÆÀ×¢£ºÆ¥ÅäÖÐÎÄ»¹ÕæÊǸöÍ·ÌÛµÄÊ£¬ÓÐÁËÕâ¸ö±í´ïʽ¾ÍºÃ°ìÁË
Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)£º[^x00-xff]
ÆÀ×¢£º¿ÉÒÔÓÃÀ´¼ÆËã×Ö·û´®µÄ³¤¶È£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
Æ¥Åä¿Õ°×ÐеÄÕýÔò±í´ïʽ£ºns*r
ÆÀ×¢£º¿ÉÒÔÓÃÀ´É¾³ý¿Õ°×ÐÐ
Æ¥ÅäHTML±ê¼ÇµÄÕýÔò±í´ïʽ£º< (S*?)[^>]*>.*?|< .*? />
ÆÀ×¢£ºÍøÉÏÁ÷´«µÄ°æ±¾Ì«Ôã¸â£¬ÉÏÃæÕâ¸öÒ²½ö½öÄÜÆ¥Å䲿·Ö£¬¶ÔÓÚ¸´ÔÓµÄǶÌ×±ê¼ÇÒÀ¾ÉÎÞÄÜΪÁ¦
Æ¥ÅäÊ×β¿Õ°××Ö·ûµÄÕýÔò±í´ïʽ£º^s*|s*$
ÆÀ×¢£º¿ÉÒÔÓÃÀ´É¾³ýÐÐÊ×ÐÐβµÄ¿Õ°××Ö·û(°üÀ¨¿Õ¸ñ¡¢ÖƱí·û¡¢»»Ò³·ûµÈµÈ)£¬·Ç³£ÓÐÓõıí´ïʽ
Æ¥ÅäEmailµØÖ·µÄÕýÔò±í´ïʽ£ºw+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*
ÆÀ×¢£º±íµ¥Ñé֤ʱºÜʵÓÃ
Æ¥ÅäÍøÖ·URLµÄÕýÔò±í´ïʽ£º[a-zA-z]+://[^s]*
ÆÀ×¢£ºÍøÉÏÁ÷´«µÄ°æ±¾¹¦ÄܺÜÓÐÏÞ£¬ÉÏÃæÕâ¸ö»ù±¾¿ÉÒÔÂú×ãÐèÇó
Æ¥ÅäÕʺÅÊÇ·ñºÏ·¨(×Öĸ¿ªÍ·£¬ÔÊÐí5-16×Ö½Ú£¬ÔÊÐí×ÖĸÊý×ÖÏ»®Ïß)£º^[a-zA-Z][a-zA-Z0-9_]{4,15}$
ÆÀ×¢£º±íµ¥Ñé֤ʱºÜʵÓÃ
Æ¥Åä¹úÄڵ绰ºÅÂ룺d{3}-d{8}|d{4}-d{7}
ÆÀ×¢£ºÆ¥ÅäÐÎʽÈç 0511-4405222 »ò 021-87888822
Æ¥ÅäÌÚѶQQºÅ£º[1-9][0-9]{4,}
ÆÀ×¢£ºÌÚѶQQºÅ´Ó10000¿ªÊ¼
Æ¥ÅäÖйúÓÊÕþ±àÂ룺[1-9]d{5}(?!d)
ÆÀ×¢£ºÖйúÓÊÕþ±àÂëΪ6λÊý×Ö
Æ¥ÅäÉí·ÝÖ¤£ºd{15}|d{18}
ÆÀ×¢£ºÖйúµÄÉí·Ý֤Ϊ15λ»ò18λ
Æ¥ÅäipµØÖ·£ºd+.d+.d+.d+
ÆÀ×¢£ºÌáÈ¡ipµØַʱÓÐÓÃ
Æ¥ÅäÌض¨Êý×Ö£º
^[1-9]d*$¡¡ ¡¡ //Æ¥ÅäÕýÕûÊý
^-[1-9]d*$ ¡¡ //Æ¥Å为ÕûÊý
^-?[1-9]d*$¡¡¡¡ //Æ¥ÅäÕûÊý
^[1-9]d*|0$¡¡ //Æ¥Åä·Ç¸ºÕûÊý£¨ÕýÕûÊý + 0£©
^-[1-9]d*|0$¡¡¡¡ //Æ¥Åä·ÇÕýÕûÊý£¨¸ºÕûÊý + 0£©
^[1-9]d*.d*|0.d*[1-9]d*$¡¡¡¡ //Æ¥ÅäÕý¸¡µãÊý
^-([1-9]d*.d*|0.d*[1-9]d*)$¡¡ //Æ¥Å为¸¡µãÊý
^-?([1-9]d*.d*|0.d*[1-9]d*|0?.0+|0)$¡¡ //Æ¥Å両µãÊý
^[1-9]d*.d*|0.d*[1-9]d*|0?.0+|0$¡¡¡¡ //Æ¥Åä·Ç¸º¸¡µãÊý£¨Õý¸¡µãÊý + 0£©
^(-([1-9]d*.d*|0.d*[1-9]d*))|0?.0+|0$¡¡¡¡//Æ¥Åä·ÇÕý¸¡µãÊý£¨¸º¸¡µãÊý + 0£©
ÆÀ×¢£º´¦Àí´óÁ¿Êý¾ÝʱÓÐÓ㬾ßÌåÓ¦ÓÃʱעÒâÐÞÕý
Æ¥ÅäÌض¨×Ö·û´®£º
^[A-Za-z]+$¡¡¡¡//Æ¥ÅäÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®
^[A-Z]+$¡¡¡¡//Æ¥ÅäÓÉ26¸öÓ¢ÎÄ×ÖĸµÄ´óд×é³ÉµÄ×Ö·û´®
^[a-
Ïà¹ØÎĵµ£º
±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔÀ´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷ÔÒò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......
AS("#...").keypress(function(event) {
if (navigator.userAgent.toLowerCase().indexOf("mozilla") >= 0) {
var $key = event.charCode ;
} else {
var $key = event. ......
È¥³ý×Ö·û´®×óÓÒÁ½¶ËµÄ¿Õ¸ñ£¬ÔÚvbscriptÀïÃæ¿ÉÒÔÇáËɵØʹÓà trim¡¢ltrim »ò rtrim£¬µ«ÔÚjsÖÐȴûÓÐÕâ3¸öÄÚÖ÷½·¨£¬ÐèÒªÊÖ¹¤±àд¡£ÏÂÃæµÄʵÏÖ·½·¨ÊÇÓõ½ÁËÕýÔò±í´ïʽ£¬Ð§Âʲ»´í£¬²¢°ÑÕâÈý¸ö·½·¨¼ÓÈëString¶ÔÏóµÄÄÚÖ÷½·¨ÖÐÈ¥¡£
<input type="text" name="mytxt" value=" 12345678 &nbs ......
<form name="f1"><select name="s1"
onchange="chg(document.f1.s1,document.f1.s2)">
<option value="½Î÷">½Î÷</option>
<option value="¸£½¨">¸£½¨</option>
</select><select name="s2">
<option value="1">1</option>
&l ......
Silverlight 3 µ÷ÓÃjavascript º¯Êý¼òµ¥Àý×Ó£º
c# code:
using System.Windows.Browser;
private void logout_but_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
HtmlPage.Wind ......