上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: Python string强转int def to_int(my_str) -> (int, bool): try: int(my_str) return int(my_str) except ValueError: # 报类型错误,说明不是整型的 try: float(my_str) # 用这个来 阅读全文
posted @ 2021-08-16 17:20 _迷途 阅读(429) 评论(0) 推荐(0)
摘要: /^([a-zA-Z0-9]+[_|_|\-|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,6}$/ 支持中间带点的邮箱格式,例如: bill.gates@gmail.com、elon.musk@twitter.c 阅读全文
posted @ 2021-07-14 10:17 _迷途 阅读(3407) 评论(0) 推荐(0)
摘要: 由于公司项目需要获取谷歌搜索结果。可是谷歌搜索出来的结果大多都不足20页。直接上代码 import time from pprint import pprint import requests from bs4 import BeautifulSoup class GoogleSpider: def 阅读全文
posted @ 2021-07-13 15:11 _迷途 阅读(407) 评论(0) 推荐(0)
摘要: public static function object_array($array) { if(is_object($array)) { $array = (array)$array; } if(is_array($array)) { foreach($array as $key=>$value) 阅读全文
posted @ 2021-07-02 18:03 _迷途 阅读(53) 评论(0) 推荐(0)
摘要: $grid->paginate(100000000)->applyFilter(); 阅读全文
posted @ 2021-07-01 17:24 _迷途 阅读(411) 评论(0) 推荐(0)
摘要: /** * @param $keywords string * @param $field string * @return array|string */ public function advance_where_or($field,$keywords) { $keywords = trim($ 阅读全文
posted @ 2021-06-22 16:55 _迷途 阅读(171) 评论(0) 推荐(0)
摘要: 创建控制器: // Windows php artisan admin:make UserController --model=App\User app\Admin\routes.php <?php use App\Admin\Controllers\UserController; use Enco 阅读全文
posted @ 2021-06-10 11:41 _迷途 阅读(1158) 评论(0) 推荐(0)
摘要: String.prototype.trim = function (char, type) { if (char) { if (type == 'left') { return this.replace(new RegExp('^\\'+char+'+', 'g'), ''); } else if 阅读全文
posted @ 2021-06-07 12:01 _迷途 阅读(612) 评论(0) 推荐(0)
摘要: function is_ip(ip){ let re = /^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\ 阅读全文
posted @ 2021-06-07 11:54 _迷途 阅读(262) 评论(0) 推荐(0)
摘要: function clearDomScriptTag(s) { var reg=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi; //生成相关正则信息 s = s.replace(reg, "");//忽略大小写的正则 return s; 阅读全文
posted @ 2021-06-07 11:52 _迷途 阅读(766) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页