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

ÕýÔò±í´ïʽ javascriptÍøÒ³¿ª·¢

´´½¨RegExp¶ÔÏóʵÀýµÄÁ½ÖÖ·½Ê½
 
1.ʹÓÃRegExp¶ÔÏóµÄÏÔʾ¹¹Ô캯Êý,Ó﷨Ϊ:new RegExp("pattern")[,"flags"];
2.ʹÓÃRegExp¶ÔÏóµÄÒþʾ¹¹Ô캯Êý,Ó﷨Ϊ:/pattern/flags;
 
3.flagsΪÒÔϱêÖ¾×Ö·ûµÄ×éºÏ
 
(1).g×÷È«¾Ö±êÖ¾,Èç¹ûûÓÐ,Æ¥ÅäµÚÒ»¸ö
 
(2). i ºöÂÔ´óСд
 
(3).m ¶àÐбêÖ¾
ÕýÔò±í´ïʽÓï·¨²Î¿¼
1.ÏÞ¶¨·û
(1).{n}:¹æ¶¨Ç°ÃæÑ¡ÏîÁ¬Ðø³öÏÖn´Î,o{2}:foooodÆ¥Åä2¸öo
(2).{n,}:¹æ¶¨Ç°ÃæÔªËØ»ò×éºÏÏîÖÁÉÙ³öÏÖn´Î,o{2,},zo²»ÐÐ,zoooo¿ÉÒÔ
(3).{n,m}:¹æ¶¨Ç°ÃæÔªËØÖÁÉÙÁ¬Ðø³öÏÖn´Î,×î¶àm´Î,o{1.3}
(4).+:±ØÐë³öÏÖÒ»´Î»òÁ¬Ðø¶à´Î.µÈЧÓÚ{1,},zo+:z²»ÐÐ,zooÐÐ
(5).*:³öÏÖ0´Î»òÁ¬Ðø¶à´Î,µÈЧ{0,},zo*,zÐÐ,zooÐÐ
(6).?:³öÏÖ0´Î»ò1´Î
2.Ñ¡ÔñÆ¥Åä·û
| : Æ¥ÅäÁ½¸öÑ¡ÏîÖÐÈÎÒâÒ»¸ö,ËüµÄÁ½¸öÑ¡ÏîÊÇ"|"×Ö·ûÁ½±ß¾¡¿ÉÄÜ×î´óµÄ±í´ïʽ.
    chapter|section 1  :Æ¥ÅäµÄÊÇchapter »ò section 1
    (chapter|section) 1 : Æ¥ÅäµÄÊÇchapter 1»ò section 1
  
3.·Ö×é×éºÏºÍ·´Ïò×÷Ó÷û
(1).(pattern):ºÏ³ÉÒ»¸ö×éºÏÏî,°´Ë³Ðò´æÔÚ»º³åÇøÖÐ.(ab);×ÖÃæÒâÒå()ÓÃ,"(",")"
 
(2).\num:µÚ¼¸¸ö»º³åÇøµÄÄÚÈÝ,¼´µÚ¼¸¸öÀ¨ºÅÖеÄÄÚÈÝ
   
     (\d)\1{4}:Á¬Ðø5¸öÏàͬµÄÊý×Ö×Ö·û:55555,11111
 
     ^b([a-z]+)\1\b/gi,ÓÃÓÚÆ¥ÅäËùÓÐÁ¬ÐøÖظ´µÄµ¥´Ê²¿·Ö,\bÓÃÓÚÆ¥Åäµ¥´Ê±ß½ç:Is the cost of of gasolin going up up
 
(3).(?:pattern):²»°ÑÕⲿ·Ö·ÅÔÚ»º³åÇøÖÐ,¼´²»µ±×÷×ÓÆ¥Åä
    
     (?:abc)
 
(4).(?=pattern):³ÆΪÕýÏò"Ô¤²âÏÈÐÐ"Æ¥Åä,ÔÚ±»ËÑË÷×Ö·û´®µÄÏàӦλÖñØÐëÓÐpattern²¿·ÖÆ¥ÅäµÄÄÚÈÝ,µ«Õⲿ·ÖÆ¥ÅäµÄÄÚÈݲ»×÷
ΪƥÅä½á¹û´¦Àí,¸ü²»»á±»´æ´¢ÔÚ²¶»ñ»º³åÇøÖй©ÒÔºóʹÓÃ
 
   Windows(?=NT|2000) : Ö»ÓëWindows 2000»òWindows NTÖеÄWindowsÆ¥Åä,¶ø²»ÓëWindows 2003ÖеÄWindowsÆ¥Åä
 
3.×Ö·ûÆ¥Åä·û
 
(1).[...]:Æ¥ÅäÀ¨ºÅÖаüº¬×Ö·û¼¯ÖеÄÈÎÒâÒ»¸ö×Ö·û,
 
     [abc]:¿ÉÒÔa,b,cÈÎÒâÒ»¸öÆ¥Åä
 
(2).[^...]Æ¥Åä³ýabcÍâµÄÈÎÒâ×Ö·û
 
(3).[a-z]:Ö¸¶¨·¶Î§ÄÚÈÎÒâ×Ö·û,Àý:[1-9].[a-z]
 
(4).[^a-z]:³ýÖ¸¶¨·¶Î§ÄÚÈÎÒâ×Ö·û,Àý:[^1-4]
(5).\d:ÈκÎÒ»¸öÊ


Ïà¹ØÎĵµ£º

¡¡javascriptº¯ÊýÌصã(zz)

¡¡javascriptº¯ÊýµÄ²ÎÊýÊÇ¿ÉÑ¡µÄ¡£ËüÓÐÏÂÃ漸¸öÌص㣺
¡¡¡¡£±.ÒòΪjavascript±¾ÉíÊÇÈõÀàÐÍ£¬ËùÒÔ£¬ËüµÄº¯Êý²ÎÊýҲûÓÐÀàÐͼì²éºÍÀàÐÍÏÞ¶¨£¬Ò»Çж¼Òª¿¿±à³ÌÕß×Ô¼ºÈ¥½øÐмì²é¡£
¡¡¡¡£².²ÎÊý¸öÊý²»¶¨¡£¾¡¹ÜÄãÒ²ÔÚÔÚº¯ÊýÉùÃ÷ʱ£¬ÓУ³¸ö²ÎÊý£¬¶øÔÚʵ¼ÊµÄʹÓÃÖУ¬Äã¿ÉÒÔ´«ÈÎÒâ¸ö²ÎÊý¸øÕâ¸öº¯Êý¡£ËüµÄʶ±ð½ö½öÊÇÒÀ¿¿º¯ÊýÃû£¬ÕâÓ ......

(תÔØ)javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ


 
[ 2007-8-6 17:03:00 | By: ibrahim ]
 
javascript²Ù×÷Select±ê¼ÇÖÐoptions¼¯ºÏ

ÏÈÀ´¿´¿´options¼¯ºÏµÄÕ⼸¸ö·½·¨£º
options.add(option)·½·¨Ïò¼¯ºÏÀïÌí¼ÓÒ»Ïîoption¶ÔÏó£»
options.remove(index)·½·¨ÒƳýoptions¼¯ºÏÖеÄÖ¸¶¨Ï
options(index)»òoptions.item(index)¿ÉÒÔͨ¹ýË÷Òý»ñÈ¡options¼¯º ......

javascript ×Ö·û´®´¦Àí


Ò»¡¢ÉùÃ÷×Ö·û´®:
var normal_monkey = "I am a monkey!<br>";
document.writeln("Normal monkey " + normal_monkey);
var bold_monkey = normal_monkey.bold();
document.writeln("Bold monkey "&n ......

ÈçºÎ±ÜÃâJavascriptʼþ°ó¶¨³öÏÖÄÚ´æй©

"These memory leaks often
occur as a result of circular references between JavaScript objects and
objects within IE’s DOM (document object model)."
GPDE Team Blog
Ã÷ÏÔµÄDOM¶ÔÏóÓë JavaScript¶ÔÏóÑ­»·ÒýÓúܺÃÅжϣ¬ÄѵÄÊÇÒþº¬µÄÑ­»·ÒýÓÃÅжϣ¡
Òþº¬µÄÑ­»·ÒýÓÃÐèҪͨ¹ý×÷ÓÃÓòÁ´½øÐзÖÎöÅÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ