摘要: Python3中正则模块re.compile、re.match及re.search函数用法 re模块 re.compile、re.match、 re.search 正则匹配的时候,第一个字符是 r,表示 raw string 原生字符,意在声明字符串中间的特殊字符不用转义。 比如表示 ‘\n',可以 阅读全文
posted @ 2019-04-11 18:38 军刀、 阅读(9161) 评论(0) 推荐(0) 编辑
摘要: 正则表达式: [\u2E80-\u9FFF]+$ 匹配所有东亚区的语言 [\u4E00-\u9FFF]+$ 匹配简体和繁体 [\u4E00-\u9FA5]+$ 匹配简体 <input type="text" name="username" onkeyup="value=value.replace([ 阅读全文
posted @ 2019-04-11 18:08 军刀、 阅读(13602) 评论(0) 推荐(0) 编辑
摘要: 廖雪峰的官方网站学习MD5加密,网址:“http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0013868328251266d86585fc9514536a638f06b41908d44 阅读全文
posted @ 2019-04-11 15:28 军刀、 阅读(10574) 评论(0) 推荐(0) 编辑
摘要: 1 import datetime 2 import time 3 4 # 获取当前时间, 其中中包含了year, month, hour, 需要import datetime 5 today = datetime.date.today() 6 print(today) 7 print(today.year) 8 print(today.month) 9 print(tod... 阅读全文
posted @ 2019-04-11 14:45 军刀、 阅读(10683) 评论(0) 推荐(0) 编辑
摘要: 1.将字符串的时间转换为时间戳方法:a = "2013-10-10 23:40:00"#将其转换为时间数组import timetimeArray = time.strptime(a, "%Y-%m-%d %H:%M:%S")#转换为时间戳:timeStamp = int(time.mktime(t 阅读全文
posted @ 2019-04-11 14:44 军刀、 阅读(37834) 评论(0) 推荐(1) 编辑