Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascript RegExp¶ÔÏóÊôÐÔÓë·½·¨ºÍÓ¦ÓÃ

RegExp¶ÔÏó£¨ÖÁ½ñΪֹÎÒ¿´µ½¹ýµÄ×îͨË×Ò×¶®ºÍÉîÈëµÄÕýÔò±í´ïʽ½Ì³Ì£©
JavaScriptÌṩÁËÒ»¸öRegExp¶ÔÏóÀ´Íê³ÉÓйØÕýÔò±í´ïʽµÄ²Ù×÷ºÍ¹¦ÄÜ£¬Ã¿Ò»ÌõÕýÔò±í´ïʽģʽ¶ÔÓ¦Ò»¸öRegExpʵÀý¡£ÓÐÁ½ÖÖ·½Ê½¿ÉÒÔ´´½¨RegExp¶ÔÏóµÄʵÀý¡£
      ʹÓÃRegExpµÄÏÔʽ¹¹Ô캯Êý£¬Ó﷨Ϊ£ºnew RegExp("pattern"[,"flags"])¡£
      ʹÓÃRegExpµÄÒþʽ¹¹Ô캯Êý£¬²ÉÓô¿Îı¾¸ñʽ£º/pattern/[flags]¡£
pattern²¿·ÖΪҪʹÓõÄÕýÔò±í´ïʽģʽÎı¾£¬ÊDZØÐëµÄ¡£ÔÚµÚÒ»ÖÖ·½Ê½ÖУ¬pattern²¿·ÖÒÔJavaScript×Ö·û´®µÄÐÎʽ´æÔÚ£¬ÐèҪʹÓÃË«ÒýºÅ»òµ¥ÒýºÅÀ¨ÆðÀ´£»ÔÚµÚ¶þÖÖ·½Ê½ÖУ¬pattern²¿·ÖǶÌ×ÔÚÁ½¸ö“/”Ö®¼ä£¬²»ÄÜʹÓÃÒýºÅ¡£
flags²¿·ÖÉèÖÃÕýÔò±í´ïʽµÄ±êÖ¾ÐÅÏ¢£¬ÊÇ¿ÉÑ¡Ïî¡£Èç¹ûÉèÖÃflags²¿·Ö£¬ÔÚµÚÒ»ÖÖ·½Ê½ÖУ¬ÒÔ×Ö·û´®µÄÐÎʽ´æÔÚ£»ÔÚµÚ¶þÖÖ·½Ê½ÖУ¬ÒÔÎı¾µÄÐÎʽ½ô½ÓÔÚ×îºóÒ»¸ö“/”×Ö·ûÖ®ºó¡£flags¿ÉÒÔÊÇÒÔϱêÖ¾×Ö·ûµÄ×éºÏ¡£
      gÊÇÈ«¾Ö±êÖ¾¡£Èç¹ûÉèÖÃÁËÕâ¸ö±êÖ¾£¬¶Ôij¸öÎı¾Ö´ÐÐËÑË÷ºÍÌæ»»²Ù×÷ʱ£¬½«¶ÔÎı¾ÖÐËùÓÐÆ¥ÅäµÄ²¿·ÖÆð×÷Óá£Èç¹û²»ÉèÖÃÕâ¸ö±êÖ¾£¬Ôò½öËÑË÷ºÍÌæ»»×îÔçÆ¥ÅäµÄÄÚÈÝ¡£
      iÊǺöÂÔ´óСд±êÖ¾¡£Èç¹ûÉèÖÃÁËÕâ¸ö±êÖ¾£¬½øÐÐÆ¥Åä±È½Ïʱ£¬½«ºöÂÔ´óСд¡£
      mÊǶàÐбêÖ¾¡£Èç¹û²»ÉèÖÃÕâ¸ö±êÖ¾£¬ÄÇôԪ×Ö·û“^”Ö»ÓëÕû¸ö±»ËÑË÷×Ö·û´®µÄ¿ªÊ¼Î»ÖÃÏàÆ¥Å䣬¶øÔª×Ö·û“$”Ö»Óë±»ËÑË÷×Ö·û´®µÄ½áÊøÎ»ÖÃÏàÆ¥Åä¡£Èç¹ûÉèÖÃÁËÕâ¸ö±êÖ¾£¬“^”»¹¿ÉÒÔÓë±»ËÑË÷×Ö·û´®Öеē\n”»ò“\r”Ö®ºóµÄλÖ㨼´ÏÂÒ»ÐеÄÐÐÊ×£©ÏàÆ¥Å䣬¶ø“$”»¹¿ÉÒÔÓë±»ËÑË÷×Ö·û´®Öеē\n”»ò“\r”Ö®ºóµÄλÖ㨼´ÏÂÒ»ÐеÄÐÐ⣩ÏàÆ¥Åä¡£
´úÂë8.1ÊÇÒ»¸ö´´½¨ÕýÔò±í´ïʽµÄÀý×Ó¡£
´úÂë8.1   ´´½¨ÕýÔò±í´ïʽ£º8.1.htm
<html>
<head>
<title>´´½¨ÕýÔò±í´ïʽ </title>
<script language = "JavaScript">
       var myString="ÕâÊǵÚÒ»¸öÕýÔò±í´ïʽµÄÀý×Ó";
       var myregex = new RegExp("Ò»¸ö");   // ´´½¨ÕýÔò±í´ïʽ
       if (myregex.test(myString)){
      


Ïà¹ØÎĵµ£º

JavaScript¼ò½é

JavaScript         ECMAScriptÊÇÕâ¸ö½Å±¾ÓïÑԵıê×¼»¯°æ±¾¡£ ScriptÔªËØ£º             ÔÚHTML´úÂëÖÐÌí¼ÓJavaScript´úÂë             Ò²¿ÉÒ԰ѽű¾´úÂë·ÅÔ ......

Ò»¸ö·Ç³£ÊµÓõÄjavascript¶ÁдCookieº¯Êý

 Ò»¸ö·Ç³£ÊµÓõÄjavascript¶ÁдCookieº¯Êý
function GetCookieVal(offset)
//»ñµÃCookie½âÂëºóµÄÖµ
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie(name, v ......

ÓÃJavaScriptÏÔʾ¹ã¸æÀ¸

 //¹ã¸æÀ¸
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// ×ó²à¹ã¸æ¾àÀëÒ³Ê׸߶È
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
e ......

ÓÃJavaScriptʵÏÖä¯ÀÀÆ÷״̬À¸·ÉÈëÎÄ×Ö

 //״̬À¸·ÉÈëÎÄ×Ö
function statusMessageObject(p,d) {  <!--????????????-->
  this.msg = MESSAGE
  this.out = " "
  this.pos = POSITION
  this.delay = DELAY
  this.i     = 0
  this.reset = clearMessage
}
function clearMessage( ......

javascript½Úµã²Ù×÷DOMDocumentÊôÐԺͷ½·¨

 http://www.xker.com/page/e2008/0807/55407.html
×î½ü·¢ÏÖDOMDocument¶ÔÏóºÜÖØÒª,»¹ÓÐXMLHTTPÒ²ºÜÖØÒª
×¢Òâ´óСдһ¶¨²»ÄÜŪ´í.
ÊôÐÔ:
1Attributes ´æ´¢½ÚµãµÄÊôÐÔÁбí(Ö»¶Á)
2childNodes ´æ´¢½ÚµãµÄ×Ó½ÚµãÁбí(Ö»¶Á)
3dataType ·µ»Ø´Ë½ÚµãµÄÊý¾ÝÀàÐÍ
4Definition ÒÔDTD»òXMLģʽ¸ø³öµÄ½ÚµãµÄ¶¨Òå(Ö»¶Á ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ