2020年3月12日

摘要: 今天完成了地域纬度和地域编号的生成。 阅读全文
posted @ 2020-03-12 22:37 方木Fengl 阅读(84) 评论(0) 推荐(0) 编辑
摘要: findall:通过正则表达式找到字符串中所有想要得字符 text="apple's price $99,orange's price $10" ret=re.findall('\$\d+',text) print(ret) sub:替换字符 text="apple's price $99,oran 阅读全文
posted @ 2020-03-12 18:31 方木Fengl 阅读(345) 评论(0) 推荐(0) 编辑
摘要: text="apple's price $99,orange's price &10" ret=re.match('.*(\$\d+).*(\&\d+)',text) print(ret.group()) 取第一组: text="apple's price $99,orange's price &1 阅读全文
posted @ 2020-03-12 18:11 方木Fengl 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 一、1、* :匹配0个或者任意多个字符 text="1234" ret=re.match('\d*',text) print(ret.group()) >>1234 2、+:匹配一个或多个字符 text="abcd" ret=re.match('\w+',text) print(ret.group( 阅读全文
posted @ 2020-03-12 17:43 方木Fengl 阅读(4511) 评论(0) 推荐(0) 编辑

导航