{"id":357,"date":"2020-02-04T23:03:59","date_gmt":"2020-02-04T15:03:59","guid":{"rendered":"https:\/\/blog.cqdefxxx.com\/?p=357"},"modified":"2020-02-04T23:03:59","modified_gmt":"2020-02-04T15:03:59","slug":"%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/blog.viter.top\/index.php\/2020\/02\/04\/%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/","title":{"rendered":"\u6b63\u5219\u8868\u8fbe\u5f0f"},"content":{"rendered":"<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\/*\n\t\t\t * \u6b63\u5219\u8868\u8fbe\u5f0f\n\t\t\t * \t- admin@atguigu.com\n\t\t\t *  - admin@.com   adminatguigu.com\n\t\t\t *  - \u90ae\u4ef6\u7684\u89c4\u5219\uff1a\n\t\t\t * \t\t1.\u524d\u8fb9\u53ef\u4ee5\u662fxxxx\u4e71\u4e03\u516b\u7cdf\n\t\t\t * \t\t2.\u8ddf\u7740\u4e00\u4e2a@\n\t\t\t * \t\t3.\u540e\u8fb9\u53ef\u4ee5\u662fxxxx\u4e71\u4e03\u516b\u7cdf\n\t\t\t * \t\t4..com\u83b7\u53d6\u5176\u4ed6\u7684\u4e71\u4e03\u516b\u7cdf\n\t\t\t * \n\t\t\t * \t- \u6b63\u5219\u8868\u8fbe\u5f0f\u7528\u4e8e\u5b9a\u4e49\u4e00\u4e9b\u5b57\u7b26\u4e32\u7684\u89c4\u5219\uff0c\n\t\t\t * \t\t\u8ba1\u7b97\u673a\u53ef\u4ee5\u6839\u636e\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u6765\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u662f\u5426\u7b26\u5408\u89c4\u5219\uff0c\n\t\t\t * \t\t\u83b7\u53d6\u5c06\u5b57\u7b26\u4e32\u4e2d\u7b26\u5408\u89c4\u5219\u7684\u5185\u5bb9\u63d0\u53d6\u51fa\u6765\n\t\t\t *\/\n\t\t\t\n\t\t\t\/\/\u521b\u5efa\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u5bf9\u8c61\n\t\t\t\/*\n\t\t\t * \u8bed\u6cd5\uff1a\n\t\t\t * \tvar \u53d8\u91cf = new RegExp(\"\u6b63\u5219\u8868\u8fbe\u5f0f\",\"\u5339\u914d\u6a21\u5f0f\");\n\t\t\t *  \u4f7f\u7528typeof\u68c0\u67e5\u6b63\u5219\u5bf9\u8c61\uff0c\u4f1a\u8fd4\u56deobject\n\t\t\t * \tvar reg = new RegExp(\"a\"); \u8fd9\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u4ee5\u6765\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709a\n\t\t\t * \u5728\u6784\u9020\u51fd\u6570\u4e2d\u53ef\u4ee5\u4f20\u9012\u4e00\u4e2a\u5339\u914d\u6a21\u5f0f\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\n\t\t\t * \t\t\u53ef\u4ee5\u662f \n\t\t\t * \t\t\ti \u5ffd\u7565\u5927\u5c0f\u5199 \n\t\t\t * \t\t\tg \u5168\u5c40\u5339\u914d\u6a21\u5f0f\n\t\t\t *\/\n\t\t\tvar reg = new RegExp(\"ab\",\"i\");\n\t\t\t\n\t\t\tvar str = \"a\";\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u65b9\u6cd5\uff1a\n\t\t\t * \ttest()\n\t\t\t * \t - \u4f7f\u7528\u8fd9\u4e2a\u65b9\u6cd5\u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u662f\u5426\u7b26\u5408\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u89c4\u5219\uff0c\n\t\t\t * \t\t\u5982\u679c\u7b26\u5408\u5219\u8fd4\u56detrue\uff0c\u5426\u5219\u8fd4\u56defalse\n\t\t\t *\/\n\t\t\tvar result = reg.test(str);\n\t\t\t\/\/console.log(result);\n\t\t\tconsole.log(reg.test(\"Ac\"));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u4f7f\u7528\u5b57\u9762\u91cf\u6765\u521b\u5efa\u6b63\u5219\u8868\u8fbe\u5f0f\n\t\t\t * \t\u8bed\u6cd5\uff1avar \u53d8\u91cf = \/\u6b63\u5219\u8868\u8fbe\u5f0f\/\u5339\u914d\u6a21\u5f0f\n\t\t\t * \u4f7f\u7528\u5b57\u9762\u91cf\u7684\u65b9\u5f0f\u521b\u5efa\u66f4\u52a0\u7b80\u5355\n\t\t\t * \t\u4f7f\u7528\u6784\u9020\u51fd\u6570\u521b\u5efa\u66f4\u52a0\u7075\u6d3b\n\t\t\t * \n\t\t\t *\/\n\t\t\t\/\/var reg = new RegExp(\"a\",\"i\");\n\t\t\t\n\t\t\tvar reg = \/a\/i;\n\t\t\t\n\t\t\t\/\/console.log(typeof reg);\n\t\t\t\/\/console.log(reg.test(\"abc\"));\n\t\t\t\n\t\t\t\/\/\u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u6709a\u6216b\n\t\t\t\/*\n\t\t\t * \u4f7f\u7528 | \u8868\u793a\u6216\u8005\u7684\u610f\u601d\n\t\t\t *\/\n\t\t\treg = \/a|b|c\/;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u6709\u5b57\u6bcd\n\t\t\t *\/\n\t\t\t\/\/reg = \/a|b|c|d|e|f|g\/;\n\t\t\t\n\t\t\t\/*\n\t\t\t * []\u91cc\u7684\u5185\u5bb9\u4e5f\u662f\u6216\u7684\u5173\u7cfb\n\t\t\t * [ab] == a|b\n\t\t\t * [a-z] \u4efb\u610f\u5c0f\u5199\u5b57\u6bcd\n\t\t\t * [A-Z] \u4efb\u610f\u5927\u5199\u5b57\u6bcd\n\t\t\t * [A-z] \u4efb\u610f\u5b57\u6bcd\n\t\t\t * [0-9] \u4efb\u610f\u6570\u5b57\n\t\t\t *\/\n\t\t\treg = \/[A-z]\/;\n\t\t\t\n\t\t\t\/\/\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709 abc \u6216 adc \u6216 aec\n\t\t\treg = \/a[bde]c\/;\n\t\t\t\n\t\t\t\/*\n\t\t\t * [^ ] \u9664\u4e86\n\t\t\t *\/\n\t\t\treg = \/[^ab]\/;\n\t\t\t\n\t\t\treg = \/[^0-9]\/;\n\t\t\t\n\t\t\tconsole.log(reg.test(\"12a3456\"));\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\tvar str = \"1a2b3c4d5e6f7\";\n\t\t\t\/*\n\t\t\t * split()\n\t\t\t * \t- \u53ef\u4ee5\u5c06\u4e00\u4e2a\u5b57\u7b26\u4e32\u62c6\u5206\u4e3a\u4e00\u4e2a\u6570\u7ec4\n\t\t\t * \t- \u65b9\u6cd5\u4e2d\u53ef\u4ee5\u4f20\u9012\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u4f5c\u4e3a\u53c2\u6570\uff0c\u8fd9\u6837\u65b9\u6cd5\u5c06\u4f1a\u6839\u636e\u6b63\u5219\u8868\u8fbe\u5f0f\u53bb\u62c6\u5206\u5b57\u7b26\u4e32\n\t\t\t * \t- \u8fd9\u4e2a\u65b9\u6cd5\u5373\u4f7f\u4e0d\u6307\u5b9a\u5168\u5c40\u5339\u914d\uff0c\u4e5f\u4f1a\u5168\u90fd\u63d2\u5206\n\t\t\t *\/\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u6839\u636e\u4efb\u610f\u5b57\u6bcd\u6765\u5c06\u5b57\u7b26\u4e32\u62c6\u5206\n\t\t\t *\/\n\t\t\tvar result = str.split(\/[A-z]\/);\n\t\t\t\n\t\t\t\n\t\t\t\/\/console.log(result);\n\t\t\t\n\t\t\t\/*\n\t\t\t * search()\n\t\t\t * \t- \u53ef\u4ee5\u641c\u7d22\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709\u6307\u5b9a\u5185\u5bb9\n\t\t\t * \t- \u5982\u679c\u641c\u7d22\u5230\u6307\u5b9a\u5185\u5bb9\uff0c\u5219\u4f1a\u8fd4\u56de\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u7d22\u5f15\uff0c\u5982\u679c\u6ca1\u6709\u641c\u7d22\u5230\u8fd4\u56de-1\n\t\t\t * \t- \u5b83\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u4f5c\u4e3a\u53c2\u6570\uff0c\u7136\u540e\u4f1a\u6839\u636e\u6b63\u5219\u8868\u8fbe\u5f0f\u53bb\u68c0\u7d22\u5b57\u7b26\u4e32\n\t\t\t * \t- serach()\u53ea\u4f1a\u67e5\u627e\u7b2c\u4e00\u4e2a\uff0c\u5373\u4f7f\u8bbe\u7f6e\u5168\u5c40\u5339\u914d\u4e5f\u6ca1\u7528\n\t\t\t *\/\n\t\t\tstr = \"hello abc hello aec afc\";\n\t\t\t\/*\n\t\t\t * \u641c\u7d22\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709abc \u6216 aec \u6216 afc\n\t\t\t *\/\n\t\t\tresult = str.search(\/a[bef]c\/);\n\t\t\t\n\t\t\t\/\/console.log(result);\n\t\t\t\n\t\t\t\n\t\t\t\/*\n\t\t\t * match()\n\t\t\t * \t- \u53ef\u4ee5\u6839\u636e\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4ece\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u5c06\u7b26\u5408\u6761\u4ef6\u7684\u5185\u5bb9\u63d0\u53d6\u51fa\u6765\n\t\t\t * \t- \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u6211\u4eec\u7684match\u53ea\u4f1a\u627e\u5230\u7b2c\u4e00\u4e2a\u7b26\u5408\u8981\u6c42\u7684\u5185\u5bb9\uff0c\u627e\u5230\u4ee5\u540e\u5c31\u505c\u6b62\u68c0\u7d22\n\t\t\t * \t\t\u6211\u4eec\u53ef\u4ee5\u8bbe\u7f6e\u6b63\u5219\u8868\u8fbe\u5f0f\u4e3a\u5168\u5c40\u5339\u914d\u6a21\u5f0f\uff0c\u8fd9\u6837\u5c31\u4f1a\u5339\u914d\u5230\u6240\u6709\u7684\u5185\u5bb9\n\t\t\t * \t\t\u53ef\u4ee5\u4e3a\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u8bbe\u7f6e\u591a\u4e2a\u5339\u914d\u6a21\u5f0f\uff0c\u4e14\u987a\u5e8f\u65e0\u6240\u8c13\n\t\t\t * \t- match()\u4f1a\u5c06\u5339\u914d\u5230\u7684\u5185\u5bb9\u5c01\u88c5\u5230\u4e00\u4e2a\u6570\u7ec4\u4e2d\u8fd4\u56de\uff0c\u5373\u4f7f\u53ea\u67e5\u8be2\u5230\u4e00\u4e2a\u7ed3\u679c\n\t\t\t * \n\t\t\t * \t\n\t\t\t *\/\n\t\t\tstr = \"1a2a3a4a5e6f7A8B9C\";\n\t\t\t\n\t\t\tresult = str.match(\/[a-z]\/ig);\n\t\t\t\n\t\t\t\/\/console.log(result[2]);\n\t\t\t\n\t\t\t\/*\n\t\t\t * replace()\n\t\t\t * \t- \u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u5185\u5bb9\u66ff\u6362\u4e3a\u65b0\u7684\u5185\u5bb9\n\t\t\t *  - \u53c2\u6570\uff1a\n\t\t\t * \t\t1.\u88ab\u66ff\u6362\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u63a5\u53d7\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u4f5c\u4e3a\u53c2\u6570\n\t\t\t * \t\t2.\u65b0\u7684\u5185\u5bb9\n\t\t\t *  - \u9ed8\u8ba4\u53ea\u4f1a\u66ff\u6362\u7b2c\u4e00\u4e2a\n\t\t\t *\/\n\t\t\t\/\/result = str.replace(\/[a-z]\/gi , \"@_@\");\n\t\t\tresult = str.replace(\/[a-z]\/gi , \"\");\n\t\t\t\n\t\t\t\/\/console.log(result);\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709aaa\n\t\t\t *\/\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u91cf\u8bcd\n\t\t\t * \t- \u901a\u8fc7\u91cf\u8bcd\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u5185\u5bb9\u51fa\u73b0\u7684\u6b21\u6570\n\t\t\t * \t- \u91cf\u8bcd\u53ea\u5bf9\u5b83\u524d\u8fb9\u7684\u4e00\u4e2a\u5185\u5bb9\u8d77\u4f5c\u7528\n\t\t\t * \t- {n} \u6b63\u597d\u51fa\u73b0n\u6b21\n\t\t\t * \t- {m,n} \u51fa\u73b0m-n\u6b21\n\t\t\t * \t- {m,} m\u6b21\u4ee5\u4e0a\n\t\t\t * \t- + \u81f3\u5c11\u4e00\u4e2a\uff0c\u76f8\u5f53\u4e8e{1,}\n\t\t\t * \t- * 0\u4e2a\u6216\u591a\u4e2a\uff0c\u76f8\u5f53\u4e8e{0,}\n\t\t\t * \t- ? 0\u4e2a\u62161\u4e2a\uff0c\u76f8\u5f53\u4e8e{0,1}\n\t\t\t *\/\n\t\t\tvar reg = \/a{3}\/;\n\t\t\t\/\/ababab\n\t\t\treg = \/(ab){3}\/;\n\t\t\t\n\t\t\treg = \/b{3}\/;\n\t\t\t\n\t\t\treg = \/ab{1,3}c\/;\n\t\t\t\n\t\t\treg = \/ab{3,}c\/;\n\t\t\t\n\t\t\treg = \/ab+c\/;\n\t\t\t\n\t\t\treg = \/ab*c\/;\n\t\t\t\n\t\t\treg = \/ab?c\/;\n\t\t\t\n\t\t\t\/\/console.log(reg.test(\"abbc\"));\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u4ee5a\u5f00\u5934\n\t\t\t * \t^ \u8868\u793a\u5f00\u5934\n\t\t\t * \t$ \u8868\u793a\u7ed3\u5c3e\n\t\t\t *\/\n\t\t\treg = \/^a\/; \/\/\u5339\u914d\u5f00\u5934\u7684a\n\t\t\t\n\t\t\treg = \/a$\/; \/\/\u5339\u914d\u7ed3\u5c3e\u7684a\n\t\t\t\n\t\t\t\/\/console.log(reg.test(\"abcabca\"));\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u5982\u679c\u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u540c\u65f6\u4f7f\u7528^ $\u5219\u8981\u6c42\u5b57\u7b26\u4e32\u5fc5\u987b\u5b8c\u5168\u7b26\u5408\u6b63\u5219\u8868\u8fbe\u5f0f\n\t\t\t *\/\n\t\t\treg = \/^a$\/;\n\t\t\t\n\t\t\t\/\/console.log(reg.test(\"bbca\"));\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u7528\u6765\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u662f\u5426\u662f\u4e00\u4e2a\u5408\u6cd5\u624b\u673a\u53f7\n\t\t\t * \n\t\t\t * \u624b\u673a\u53f7\u7684\u89c4\u5219\uff1a\n\t\t\t * \t1 3 567890123 \uff0811\u4f4d\uff09\n\t\t\t * \t\n\t\t\t * \t1. \u4ee51\u5f00\u5934\n\t\t\t *  2. \u7b2c\u4e8c\u4f4d3-9\u4efb\u610f\u6570\u5b57\n\t\t\t * \t3. \u4e09\u4f4d\u4ee5\u540e\u4efb\u610f\u6570\u5b579\u4e2a\n\t\t\t * \n\t\t\t *  ^1   [3-9]  [0-9]{9}$  \n\t\t\t * \n\t\t\t *\/\n\t\t\t\n\t\t\tvar phoneStr = \"13067890123\";\n\t\t\t\n\t\t\tvar phoneReg = \/^1[3-9][0-9]{9}$\/;\n\t\t\t\n\t\t\tconsole.log(phoneReg.test(phoneStr));\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709 .\n\t\t\t * . \u8868\u793a\u4efb\u610f\u5b57\u7b26\n\t\t\t * \u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\\\u4f5c\u4e3a\u8f6c\u4e49\u5b57\u7b26\n\t\t\t * \\. \u6765\u8868\u793a.\n\t\t\t * \\\\  \u8868\u793a\\\n\t\t\t * \n\t\t\t * \u6ce8\u610f\uff1a\u4f7f\u7528\u6784\u9020\u51fd\u6570\u65f6\uff0c\u7531\u4e8e\u5b83\u7684\u53c2\u6570\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u800c\\\u662f\u5b57\u7b26\u4e32\u4e2d\u8f6c\u4e49\u5b57\u7b26\uff0c\n\t\t\t * \t\u5982\u679c\u8981\u4f7f\u7528\\\u5219\u9700\u8981\u4f7f\u7528\\\\\u6765\u4ee3\u66ff\n\t\t\t *\/\n\t\t\tvar reg = \/\\.\/;\n\t\t\t\n\t\t\treg = \/\\\\\/;\n\t\t\t\n\t\t\treg = new RegExp(\"\\\\.\");\n\t\t\treg = new RegExp(\"\\\\\\\\\");\n\t\t\t\n\t\t\t\/*\n\t\t\t * \\w\n\t\t\t * \t- \u4efb\u610f\u5b57\u6bcd\u3001\u6570\u5b57\u3001_  [A-z0-9_]\n\t\t\t * \\W\n\t\t\t * \t- \u9664\u4e86\u5b57\u6bcd\u3001\u6570\u5b57\u3001_  [^A-z0-9_]\n\t\t\t * \\d\n\t\t\t * \t- \u4efb\u610f\u7684\u6570\u5b57 [0-9]\n\t\t\t * \\D\n\t\t\t * \t- \u9664\u4e86\u6570\u5b57 [^0-9]\n\t\t\t * \\s\n\t\t\t * \t- \u7a7a\u683c\n\t\t\t * \\S\n\t\t\t * \t- \u9664\u4e86\u7a7a\u683c\n\t\t\t * \\b\n\t\t\t * \t- \u5355\u8bcd\u8fb9\u754c\n\t\t\t * \\B\n\t\t\t * \t- \u9664\u4e86\u5355\u8bcd\u8fb9\u754c\n\t\t\t *\/\n\t\t\t\n\t\t\treg = \/\\w\/;\n\t\t\treg = \/\\W\/;\n\t\t\t\n\t\t\treg = \/\\d\/;\n\t\t\treg = \/\\D\/;\n\t\t\t\n\t\t\treg = \/\\s\/;\n\t\t\treg = \/\\S\/;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u521b\u5efa\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u68c0\u67e5\u4e00\u4e2a\u5b57\u7b26\u4e32\u4e2d\u662f\u5426\u542b\u6709\u5355\u8bcdchild\n\t\t\t *\/\n\t\t\t\n\t\t\treg = \/\\bchild\\b\/;\n\t\t\t\n\t\t\t\/\/console.log(reg.test(\"hello child \"));\n\t\t\t\n\t\t\t\/\/\u63a5\u6536\u4e00\u4e2a\u7528\u6237\u7684\u8f93\u5165\n\t\t\t\/\/var str = prompt(\"\u8bf7\u8f93\u5165\u4f60\u7684\u7528\u6237\u540d:\");\n\t\t\t\n\t\t\tvar str = \"              he      llo                \";\n\t\t\t\n\t\t\t\/\/\u53bb\u9664\u6389\u5b57\u7b26\u4e32\u4e2d\u7684\u524d\u540e\u7684\u7a7a\u683c\n\t\t\t\/\/\u53bb\u9664\u7a7a\u683c\u5c31\u662f\u4f7f\u7528\"\"\u6765\u66ff\u6362\u7a7a\u683c\n\t\t\tconsole.log(str);\n\t\t\t\n\t\t\t\/\/str = str.replace(\/\\s\/g , \"\");\n\t\t\t\n\t\t\t\/\/\u53bb\u9664\u5f00\u5934\u7684\u7a7a\u683c\n\t\t\t\/\/str = str.replace(\/^\\s*\/, \"\");\n\t\t\t\/\/\u53bb\u9664\u7ed3\u5c3e\u7684\u7a7a\u683c\n\t\t\t\/\/str = str.replace(\/\\s*$\/, \"\");\n\t\t\t\/\/ \/^\\s*|\\s*$\/g \u5339\u914d\u5f00\u5934\u548c\u7ed3\u5c3e\u7684\u7a7a\u683c\n\t\t\tstr = str.replace(\/^\\s*|\\s*$\/g,\"\");\n\t\t\t\n\t\t\t\n\t\t\tconsole.log(str);\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h1>\u90ae\u4ef6\u7684\u6b63\u5219\uff1a<\/h1>\n<pre class=\"pure-highlightjs\"><code class=\"\">&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;meta charset=\"UTF-8\"&gt;\n\t\t&lt;title&gt;&lt;\/title&gt;\n\t\t&lt;script type=\"text\/javascript\"&gt;\n\t\t\t\n\t\t\t\/*\n\t\t\t * \u7535\u5b50\u90ae\u4ef6\n\t\t\t * \thello  .nihao          @     abc  .com.cn\n\t\t\t * \n\t\t\t * \u4efb\u610f\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf    .\u4efb\u610f\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf  @   \u4efb\u610f\u5b57\u6bcd\u6570\u5b57     .\u4efb\u610f\u5b57\u6bcd\uff082-5\u4f4d\uff09   .\u4efb\u610f\u5b57\u6bcd\uff082-5\u4f4d\uff09\n\t\t\t * \n\t\t\t * \\w{3,}  (\\.\\w+)*  @  [A-z0-9]+  (\\.[A-z]{2,5}){1,2}\n\t\t\t *\/\n\t\t\t\n\t\t\tvar emailReg = \/^\\w{3,}(\\.\\w+)*@[A-z0-9]+(\\.[A-z]{2,5}){1,2}$\/;\n\t\t\t\n\t\t\tvar email = \"abc.hello@163.com\";\n\t\t\t\n\t\t\tconsole.log(emailReg.test(email));\n\t\t\t\n\t\t\t\n\t\t&lt;\/script&gt;\n\t&lt;\/head&gt;\n\t&lt;body&gt;\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset= &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[4],"_links":{"self":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/357"}],"collection":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":0,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.viter.top\/index.php\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}