¿ï¾ÜÃD
²µªÃD
- ½Ð¼g¤@Ó³q¥Î¦¡¨Ó¶i¦æ¨¥÷ÃÒ¦r¸¹ªºÂ²©ö¤ñ¹ï¡C¡]°²³]¨¥÷ÃÒ¦r¸¹¬O¥Ñ¤@Ó^¤å¦r¥À¥[¤W¤EӼƦr©Ò²Õ¦¨¡C¡^
- ½Ð¼g¤@Ó³q¥Î¦¡¨Ó¶i¦æ«H¥Î¥d¥d¸¹ªºÂ²©ö¤ñ¹ï¡C¡]°²³]«H¥Î¥d¥d¸¹ªº®æ¦¡¬O xxxx-xxxx-xxxx-xxxx¡A¨ä¤¤¨C¤@Ó x ³£¬O¥Nªí¤@ӼƦr¡C¡^
- µ¹©w¤@Ó¦r¦êÅÜ¼Æ x = " ª÷ ¡@¡@«°¡@ ªZ "¡A½Ð»¡©ú¦p¦ó¨Ï¥Î³q¥Î¦¡¨Ó§R°£¦¹¦r¦ê¤¤ªºªÅ¥Õ¡]¥]§t¥þ§ÎªÅ¥Õ¡B¥b§ÎªÅ¥Õ¡B©w¦ìÁäµ¥¡^¡C
- ½Ð»¡©ú¦p¦ó±N³q¥Î¦¡±Ä¥Îªº¡u³g¤ß¤ñ¹ï¡v§ï¦¨¡u³Ì¤p¤ñ¹ï¡v¡C
- ½Ð»¡©ú³q¥Î¦¡©Ò±Ä¥Îªº¡u¶V¥ª¶V³g¡vªº¾÷¨î¬°¦ó¡H½ÐÁ|¹ê¨Ò¨Ó»¡©ú¡C
- ½Ð»¡©ú¤U¦C³q¥Î¦¡ªº²[¸q¡G
- /^xy/
- /xy$/
- /[13579]/
- /[0-9]/
- /[a-z0-9]/
- /[a-zA-Z0-9]/
- /b[aeiou]t/
- /[^0-9]/
- /[^aeiouAEIOU]/
- /a.b/
- /a.*b/
- /a.*?b/
- /[^\^]/
- /^.+@.+\..{2,3}$/
µ{¦¡ÃD
½ÐºÉ¶q¨Ï¥Î¥»³¹©Ò¾Ç¨ìªº³q¥Îªí¥Üªk¨Ó§¹¦¨¤U¦C§@·~¡G
- (*) ¤¹³\¨¥÷ÃÒ¦r¸¹²Ä¤@Ó¦r¥À¤j¤p¼g§¡¥i: ½Ðקï½d¨Ò regExpId01.htm¡A²£¥Í·sºô¶¡AÅý¨Ï¥ÎªÌ¿é¤Jªº¨¥÷ÃÒ¦r¸¹ªº²Ä¤@Ó^¤å¦r¥À¤£¤j¼g©Î¤p¼g¡C
- (*) ¹ï^¤å©m¦W¶i¦æ×¥¿: ½Ðקï½d¨Ò regExpEnglishName01.htm¡A²£¥Í·sºô¶¡AÅý¨Ï¥ÎªÌ¦bÅçÃÒ¸ê®Æ®É¡Aµ{¦¡½X·|¥ý¹ï^¤å¦W¦r¶i¦æ×¥¿¡G§â¨CÓ¦r·Jªº²Ä¤@Ó¦r¥À§ï¦¨¤j¼g¡A¨ä¾l¤p¼g¡C
- (*) ¶Ã¼Æ²£¥Í¨¥÷ÃÒ¦r¸¹: ½Ð®Ú¾Ú¨¥÷ÃÒ¸¹½Xªº½s½X³W«h¡A§Q¥Î¶Ã¼Æ¡A¤@¦¸²£¥Í¤²Õ¦³®Äªº¨¥÷ÃÒ¸¹½X¡A½d¨Òªí³æ¦p¤U¡G
½Ðª`·N¡G
- ¿é¤Jªº^¤å¦r¥À¥²¶·¬O¦X®æªº¡C
- ¥²¶·±N^¤å¦r¥ÀÂন¤j¼g¡A¦A¥[¤W¤E¦ì¼Æ¦r¡C
- ¥²¶·§Q¥Î¶Ã¼Æ²£¥Í¡A©Ò¥H¨C¦¸²£¥Íªº¤²Õ¸¹½X³£À³¸Ó¤£¤@¼Ë¡C
- (*) ¶Ã¼Æ²£¥Í«H¥Î¥d¥d¸¹: ½Ð®Ú¾Ú«H¥Î¥d¸¹½Xªº½s½X³W«h¡A§Q¥Î¶Ã¼Æ¡A¤@¦¸²£¥Í¤²Õ¦³®Äªº«H¥Î¥d¸¹½X¡A½d¨Òªí³æ¦p¤U¡G
- (**) ¨¥÷ÃÒ¦r¸¹ÅçÃÒ: ¹ï¨Ï¥ÎªÌ¿é¤Jªº¨¥÷ÃÒ¦r¸¹¶i¦æ°ò¥»ÅçÃÒ¡G½Ð§A¥²¶·³]p¤@Óºô¶¡A¥]§t¤@Ó¤å¦rÄæ¦ì¡A¯àÅý¨Ï¥ÎªÌ¿é¤JÓ¤Hªº¨¥÷ÃÒ¦r¸¹¡A¨Ã¦b«ö¤U¡uÅçÃÒ¡v¶s«á¡AÅçÃÒ¦¹¿é¤J¸ê®Æ¡CY¿é¤J¸ê®Æº¡¨¬¨¥÷ÃÒ¦r¸¹ªº½s½X³W«h¡A«h¥Hĵ§iµøµ¡Åã¥Ü¡u³q¹L¡v¡A§_«hÅã¥Ü¡u¤£³q¹L¡v¡C¡]¨¥÷ÃÒ¦r¸¹ªº²Ä¤@Ó¦r¥À¡A¥i¥H¤¹³\¬O¤j¼g©Î¤p¼g¡C¡^½d¨Òªí³æ¦p¤U¡G
- (**) «H¥Î¥d¥d¸¹ÅçÃÒ: ¹ï¨Ï¥ÎªÌ¿é¤Jªº«H¥Î¥d¥d¸¹¶i¦æ°ò¥»ÅçÃÒ¡G½Ð§A¥²¶·³]p¤@Óºô¶¡A¥]§t¤@Ó¤U©Ô¦¡¿ï³æ¡A¥i¥HÅý¨Ï¥ÎªÌ¶ñ¤J«H¥Î¥dÃþ§O¡]Visa¡BMaster¡BAmerican Express¡^¡A¥H¤Î¤@Ó¤å¦rÄæ¦ì¡A¯àÅý¨Ï¥ÎªÌ¿é¤JÓ¤Hªº«H¥Î¥d¥d¸¹¡A¨Ã¦b«ö¤U¡uÅçÃÒ¡v¶s«á¡AÅçÃÒ¦¹¿é¤J¸ê®Æ¡CY¿é¤J¸ê®Æº¡¨¬«H¥Î¥d¥d¸¹ªº½s½X³W«h¡A«h¥Hĵ§iµøµ¡Åã¥Ü¡u³q¹L¡v¡A§_«hÅã¥Ü¡u¤£³q¹L¡v¡C½d¨Òªí³æ¦p¤U¡G
- (***) ¹q¤l¶l¥óÅçÃÒ: §óºë·Çªº¹q¤l¶l¥ó³q¥Î¦¡¡G¦b½d¨Ò regExpEmail01.htm ¤¤¡A§Ų́ϥΤ@Ó²³æªº³q¥Î¦¡¡u/^.+@.+\..{2,3}$/¡v¨Ó¥Nªí¹q¤l¶l¥óªº®æ¦¡¡C¦ý¬O¨Æ¹ê¤W¡A¦¹³q¥Î¦¡¨Ã¤£§¹¥þºë·Ç¡A½Ð§A³]p¤@Óºô¶ regExpEmail02.htm¡A¨Ï¥Î¸û½ÆÂøªº³q¥Î¦¡¡A¥i¥H§óºë·Ç¦aªí¥Ü¤@¯ë¹q¤l¶l¥óªº®æ¦¡¡Aºô¶®æ¦¡¦p¤U¡G
½Ð°È¥²»¡©ú§Aªº³q¥Î¦¡¦p¦ó¯àºë·Ç¦a´yz¹q¤l¶l¥óªº®æ¦¡¡C
- (***) HTTPºô§}ÅçÃÒ: ½Ð³]p¤@Óºô¶¡A¯à°÷ºë½T¦a´yz¤@Ó¥H¡uhttp://¡v¶}©lªºÓ¤Hºô§}¡A°ò¥»n¨D¦p¤U¡G
ºô¶®æ¦¡¦p¤U¡G
- ¦X®æºô§}½d¨Ò¡Ghttp://www.cs.nthu.edu.tw/~jang", "http://www.mathworks.com", "http://www.cs.nthu.edu.tw:4500/~jang/publie/index.asp"
- ¤£¦X®æºô§}½d¨Ò¡G"www.mathworks.com", "http://www..com"
½Ð°È¥²»¡©ú§Aªº³q¥Î¦¡¦p¦ó¯àºë·Ç¦a´yz http ªººô§}®æ¦¡¡C
- (**) ¹ïªí³æ¸ê®Æ¶i¦æ×¥¿¤ÎÅçÃÒ: ½Ð¥Î³q¥Îªí¥Üªk¨Ó¹ï¤U¦Cªí³æ¸ê®Æ¶i¦æ×¥¿¤ÎÅçÃÒ¡G
- (***) ©â¨úºô¶¤¤ªº³sµ²: ¦b¦¹§@·~¤¤¡A§Ú̱N½m²ß¨Ï¥Î³q¥Îªí¥Üªk¨Ó©â¨úºô¶¤¤ªº³sµ²¡]¥]§t¤å¦r»Pºô§}¡^¡C¬°¤F¨ú±oºô¶ªº¤º®e¡A§ÚÌ¥²¶·§ï¥Î WSH (Window Scripting Host) ¨Ó¶i¦æ¦¹§@·~¡A¤@Ó²³æªº WSH ½d¨Òµ{¦¡¦p¤U¡G
Yn°õ¦æ¦¹½d¨Ò¡A½Ð¤U¸ü¦¹½d¨Ò«á¡A¦b DOS µøµ¡¿é¤J
cscript titleExtract.js °²³]ºô¸ôºZ³q¡A«h¦¹®É¦bµøµ¡©ÒÅã¥Üªºµ²ªG¦p¤U¡GMicrosoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. index = 14 title = Web Programming (CS3431): Test page for link extraction ¥Ñ¦¹¥i¨£¦¹½d¨Ò¥i¥H¥¿½T¦a©â¥X©Òµ¹ºô¶ªº¼ÐÃD¡C½Ðª`·N¡AWSH Àɮתº°ÆÀɦW¬O js¡A¥Nªí©Ò¥Îªºµ{¦¡»y¨¥¬O JavaScript¡A©Ò¥H¥»¸`©Ò±Ðªº³q¥Îªí¥Üªk³£¥i¥H¨Ï¥Î¡C°ß¤@ªº¤p®t§O¬O¡GYn¦L¥X¦r¦ê¡A¦b WSH ¥²¶·¨Ï¥Î WScript.Echo("...")¡C§Aªº¥ô°È¡A´N¬O§ï¼g¦¹ÀɮסA¨Ï¨ä¯à¨Ï¥Î³q¥Îªí¥Üªk¨Ó§ì¥X¬Y¤@Óºô¶ªº³sµ²¡A¥]§t³sµ²ªº¤å¦r»P³sµ²ªººô§}¡C½Ðª`·N¡A§Aªºµ{¦¡½Xªº¥\¯à¥i¥H¥Ñ²L¤J²`¡A¹F¨ì¤Uz¤T¶µ¥\¯à¡G
- ¯à°÷¥¿½T¦a©â¨úÃþ¦ü¤U¦Cªº³sµ²¡G
- ¤¶©ó <xmp> »P </xmp> ¤§¶¡ªº³sµ²¡A¤£À³¸Ó³Q©â¨ú¡C
- ¯à°÷¤À¿ë¦Pºô°ì (Same-domain) ªº³sµ²©M²§ºô°ì (Different-domain)ªº³sµ²¡C
Y¥H¥»§@·~ºô¶¬°¨Ò¡A©Ò²£¥Íªº¿é¥XÀ³¸ÓÃþ¦ü¤Uzµ²ªG¡G
Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation 1996-2001. All rights reserved. regExpId01.htm ===> example/regExpId01.htm ===> Same domain regExpEnglishName01.htm ===> example/regExpEnglishName01.htm ===> Same domain generateIdNumber01.htm ===> exerciseTemplate/generateIdNumber01.htm ===> Same domain ... titleExtract.js ===> example/titleExtract.js ===> Same domain ©Òµ¹ºô¶ ===> http://mirlab.org/jang/courses/webProgramming/homework/linkExtraction/testPage4linkExtraction.htm ===> Same domain It's me ===> /jang ===> Same domain This is Google ===> http://www.google.com ===> Different domain JavaScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©ó¥Î¤áºÝ ===> /jang/books/javaScript ===> Same domain ¡]½Ð¸Õ¬Ý¬Ý§U±Ð©Òµ¹ªº´ú¸Õºô¶¡C¡^
JavaScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©óºô¶¥Î¤áºÝ