xcheck.js

来自「一个免费的php的blog程序,很好用」· JavaScript 代码 · 共 53 行

JS
53
字号
// **********************************************************//// Copyright 2002-2003 Sebastian Werner// http://sebastian-werner.net// // Licensed under://// Attribution-NonCommercial-ShareAlike License 1.0// by CreativeCommon (http://creativecommons.org)//// Key License Terms:// * Attribution. //   The licensor permits others to copy, distribute, //   display, and perform the work. In return, licensees //   must give the original author credit.// * Noncommercial. //   The licensor permits others to copy, distribute, //   display, and perform the work. In return, licensees //   may not use the work for commercial purposes -- unless //   they get the licensor's permission.// * Share Alike. //   The licensor permits others to distribute derivative //   works only under a license identical to the one that //   governs the licensor's work.//// for details visit:// http://creativecommons.org/licenses/by-nc-sa/1.0///// **********************************************************// **********************************************************//  CHECK// **********************************************************function xCheck(){  this.email = function(email) {    var proto = "(mailto:)?";    var usr = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";    var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";    var regex = "^" + proto + "?" + usr + "\@" + domain + "$";    var rgx = new RegExp(regex);    return rgx.exec(email) ? true : false;  }}  _check = new xCheck();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?