python re正则表达式模块(Regular Expression)

发表于 5年以前  | 总阅读数:1421 次

模块的的作用主要是用于字符串和文本处理,查找,搜索,替换等

复习一下基本的正则表达式吧

.:匹配除了换行符以为的任意单个字符

*:匹配任意字符,一个,零个,多个都能匹配得到 俗称贪婪模式

+:匹配位于+之前的一个或者多个字符

|:匹配位于|之前或者之后的字符

^:匹配行首

$:匹配行尾

?:匹配位于?之前的零个或者一个字符,不匹配多个字符

\:表示 \ 之后的为转义字符

[]:匹配[]之中的任意单个字符,[0-9]表示匹配0到9任意一个数字

():将位于()之内的的内容当作一个整体

{}:按{}中的次数进行匹配,100[0-9]{3}表示在100之后任意匹配一个3位数(100-999)

python中以\开头的元字符:

特殊序列符号

意义

\A

只在字符串开始进行匹配

\Z

只在字符串结尾进行匹配

\b

匹配位于开始或结尾的空字符串

\B

匹配不位于开始或结尾的空字符串

\d

相当于[0-9]

\D

相当于[^0-9]

\s

匹配任意空白字符:[\t\n\r\r\v]

\S

匹配任意非空白字符:[^\t\n\r\r\v]

\w

匹配任意数字和字母:[a-zA-Z0-9]

\W

匹配任意非数字和字母:[^a-zA-Z0-9]

正则表达式语法表

语法 意义 说明

"." 任意字符

"^" 字符串开始 '^hello'匹配'helloworld'而不匹配'aaaahellobbb'

"$" 字符串结尾 与上同理

"*"

0 个或多个字符(贪婪匹配)

<*>匹配chinaunix

"+"

1 个或多个字符(贪婪匹配)

与上同理

"?"

0 个或多个字符(贪婪匹配)

与上同理

*?,+?,??

以上三个取第一个匹配结果(非贪婪匹配) <*>匹配 </p> <p>{m,n} </p> <p>对于前一个字符重复m到n次,{m}亦可 </p> <p>a{6}匹配6个a、a{2,4}匹配2到4个a</p> <p>{m,n}? </p> <p>对于前一个字符重复m到n次,并取尽可能少 </p> <p>'aaaaaa'中a{2,4}只会匹配2个</p> <p>"\\" </p> <p>特殊字符转义或者特殊序列</p> <p>[] </p> <p>表示一个字符集 [0-9]、[a-z]、[A-Z]、[^0]</p> <p>"|" </p> <p>或 A|B,或运算</p> <p>(...) </p> <p>匹配括号中任意表达式</p> <p>(?#...) </p> <p>注释,可忽略</p> <p>(?=...) </p> <p>Matches if ... matches next, but doesn't consume the string. </p> <p>'(?=test)' 在hellotest中匹配hello</p> <p>(?!...) </p> <p>Matches if ... doesn't match next. </p> <p>'(?!=test)' 若hello后面不为test,匹配hello </p> <p>(?<=...) </p> <p>Matches if preceded by ... (must be fixed length). </p> <p>'(?<=hello)test' 在hellotest中匹配test </p> <p>(?<!...) </p> <p>Matches if not preceded by ... (must be fixed length). </p> <p>'(?<!hello)test' 在hellotest中不匹配test </p> <p>匹配的标志和含义</p> <p><strong>标志</strong> <strong>含义</strong></p> <p>re.I 忽略大小写</p> <p>re.L 根据本地设置而更改\w,\W,\b,\B,\s,\S的匹配内容</p> <p>re.M 多行匹配模式</p> <p>re.S 使"."元字符匹配换行符</p> <p>re.U 匹配Unicode字符</p> <p>re.X 忽略需要匹配模式中的空格,并且可以使用"#"号注释</p> <p>文本内容(提取Linux下的password文件)</p> <pre><code> man:x:6:12:man:/var/cache/man:/bin/nologin </code></pre> <p>re模块中有3个搜索函数,每个函数都接受3个参数(匹配模式,要匹配的字符串,进行匹配的标志),如果匹配到了就返回一个对象实例,么有就返会None.</p> <p>findall():用于在字符串中查找符合正则表达式的字符串,并返回这些字符串的列表</p> <p>search():搜索整个字符串,返回对象实例</p> <p>match():只从第一个字符开始匹配,后面的不再匹配,返回对象实例</p> <pre><code> lovelinux@LoveLinux:~/py/boke$ cat text man:x:6:12:man:/var/cache/man:/bin/sh lovelinux@LoveLinux:~/py/boke$ cat test.py #/usr/bin/env python #coding:utf-8 import re with open('text','r') as txt: f = txt.read() print re.match('bin',f) print re.search('bin',f).end() lovelinux@LoveLinux:~/py/boke$ python test.py None 34 lovelinux@LoveLinux:~/py/boke$ vim test.py lovelinux@LoveLinux:~/py/boke$ python test.py None <_sre.SRE_Match object at 0x7f12fc9f9ed0> </code></pre> <p>返回是对象实例有2个方法,</p> <p>start():返回记录匹配到字符的开始索引 </p> <p>end():返回记录匹配到字符的结束索引</p> <pre><code> lovelinux@LoveLinux:~/py/boke$ python test.py None 31 34 lovelinux@LoveLinux:~/py/boke$ cat test.py #/usr/bin/env python #coding:utf-8 import re with open('text','r') as txt: f = txt.read() print re.match('bin',f) print re.search('bin',f).start() print re.search('bin',f).end() </code></pre> </div> </div> </div> <div class="blockgap"></div> <div style="background-color:#fff;padding-top:8px;border-radius: 4px;padding-bottom:8px;"> <div style="margin-left:21px;"> <script type="text/javascript"> (function() { var s = "_" + Math.random().toString(36).slice(2); document.write('<div style="" id="' + s + '"></div>'); (window.slotbydup = window.slotbydup || []).push({ id: "u3790074", container: s }); })(); </script> </div> </div> <div class="blockgap"></div> <div class="sideblock"> <div class="block-title"><i style="font-size:1.8rem;" class="fab fa-audible"></i><span style="font-size:1.8rem;"> 相关推荐</span></div> <div class="block-body"> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn/img/2023-09-04/71a1bb7210e2f17f8e0e3e49647fbe46.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/219.html"> 刘强东夫妇:“移民美国”传言被驳斥 </a> </h3> <div class="tp-postitem-summary"> <p> 京东创始人刘强东和其妻子章泽天最近成为了互联网舆论关注的焦点。有关他们“移民美国”和在美国购买豪宅的传言在互联网上广泛传播。然而,京东官方通过微博发言人发布的消息澄清了这些传言,称这些言论纯属虚假信息和蓄意捏造。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >808次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/219.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/huwei.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/901.html"> 博主曝三大运营商,将集体采购百万台华为Mate60系列 </a> </h3> <div class="tp-postitem-summary"> <p> 日前,据博主“@超能数码君老周”爆料,国内三大运营商中国移动、中国电信和中国联通预计将集体采购百万台规模的华为Mate60系列手机。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >770次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/901.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/8/284.html"> ASML CEO警告:出口管制不是可行做法,不要“逼迫中国大陆创新” </a> </h3> <div class="tp-postitem-summary"> <p> 据报道,荷兰半导体设备公司ASML正看到美国对华遏制政策的负面影响。阿斯麦(ASML)CEO彼得·温宁克在一档电视节目中分享了他对中国大陆问题以及该公司面临的出口管制和保护主义的看法。彼得曾在多个场合表达了他对出口管制以及中荷经济关系的担忧。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>756次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/8/284.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/douyin.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/5/467.html"> 抖音中长视频App青桃更名抖音精选,字节再发力对抗B站 </a> </h3> <div class="tp-postitem-summary"> <p> 今年早些时候,抖音悄然上线了一款名为“青桃”的 App,Slogan 为“看见你的热爱”,根据应用介绍可知,“青桃”是一个属于年轻人的兴趣知识视频平台,由抖音官方出品的中长视频关联版本,整体风格有些类似B站。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >648次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/5/467.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn/img/2023-09-05/306e611a07fbb00c7022a7014b0b7f73"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/5/927.html"> 威马CDO:中国每百户家庭仅17户有车 </a> </h3> <div class="tp-postitem-summary"> <p> 日前,威马汽车首席数据官梅松林转发了一份“世界各国地区拥车率排行榜”,同时,他发文表示:中国汽车普及率低于非洲国家尼日利亚,每百户家庭仅17户有车。意大利世界排名第一,每十户中九户有车。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >589次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/5/927.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/526.html"> 研究发现维生素 C 等抗氧化剂会刺激癌症生长和转移 </a> </h3> <div class="tp-postitem-summary"> <p> 近日,一项新的研究发现,维生素 C 和 E 等抗氧化剂会激活一种机制,刺激癌症肿瘤中新血管的生长,帮助它们生长和扩散。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>449次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/526.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/apple.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/1/463.html"> 苹果据称正引入3D打印技术,用以生产智能手表的钢质底盘 </a> </h3> <div class="tp-postitem-summary"> <p> 据媒体援引消息人士报道,苹果公司正在测试使用3D打印技术来生产其智能手表的钢质底盘。消息传出后,3D系统一度大涨超10%,不过截至周三收盘,该股涨幅回落至2%以内。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >446次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/1/463.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn/img/2023-09-04/feaca95ded3028bc03a8da8a0e24a1a2"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/1044.html"> 千万级抖音网红秀才账号被封禁 </a> </h3> <div class="tp-postitem-summary"> <p> 9月2日,坐拥千万粉丝的网红主播“秀才”账号被封禁,在社交媒体平台上引发热议。平台相关负责人表示,“秀才”账号违反平台相关规定,已封禁。据知情人士透露,秀才近期被举报存在违法行为,这可能是他被封禁的部分原因。据悉,“秀才”年龄39岁,是安徽省亳州市蒙城县人,抖音网红,粉丝数量超1200万。他曾被称为“中老年... </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >445次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/1044.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/302.html"> 亚马逊股东起诉公司和贝索斯,称其在购买卫星发射服务时忽视了 SpaceX </a> </h3> <div class="tp-postitem-summary"> <p> 9月3日消息,亚马逊的一些股东,包括持有该公司股票的一家养老基金,日前对亚马逊、其创始人贝索斯和其董事会提起诉讼,指控他们在为 Project Kuiper 卫星星座项目购买发射服务时“违反了信义义务”。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>444次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/302.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/apple.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/725.html"> 苹果上线AppsbyApple网站,以推广自家应用程序 </a> </h3> <div class="tp-postitem-summary"> <p> 据消息,为推广自家应用,苹果现推出了一个名为“Apps by Apple”的网站,展示了苹果为旗下产品(如 iPhone、iPad、Apple Watch、Mac 和 Apple TV)开发的各种应用程序。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >442次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/725.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/tesla.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/647.html"> 特斯拉美国降价引发投资者不满:“这是短期麻醉剂” </a> </h3> <div class="tp-postitem-summary"> <p> 特斯拉本周在美国大幅下调Model S和X售价,引发了该公司一些最坚定支持者的不满。知名特斯拉多头、未来基金(Future Fund)管理合伙人加里·布莱克发帖称,降价是一种“短期麻醉剂”,会让潜在客户等待进一步降价。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >441次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/647.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/664.html"> 光刻机巨头阿斯麦:拿到许可,继续对华出口 </a> </h3> <div class="tp-postitem-summary"> <p> 据外媒9月2日报道,荷兰半导体设备制造商阿斯麦称,尽管荷兰政府颁布的半导体设备出口管制新规9月正式生效,但该公司已获得在2023年底以前向中国运送受限制芯片制造机器的许可。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>437次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/664.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/elonmask.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/118.html"> 马斯克与库克首次隔空合作:为苹果提供卫星服务 </a> </h3> <div class="tp-postitem-summary"> <p> 近日,根据美国证券交易委员会的文件显示,苹果卫星服务提供商 Globalstar 近期向马斯克旗下的 SpaceX 支付 6400 万美元(约 4.65 亿元人民币)。用于在 2023-2025 年期间,发射卫星,进一步扩展苹果 iPhone 系列的 SOS 卫星服务。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >430次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/118.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/elonmask.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/260.html"> 𝕏(推特)调整隐私政策,可拿用户发布的信息训练 AI 模型 </a> </h3> <div class="tp-postitem-summary"> <p> 据报道,马斯克旗下社交平台𝕏(推特)日前调整了隐私政策,允许 𝕏 使用用户发布的信息来训练其人工智能(AI)模型。新的隐私政策将于 9 月 29 日生效。新政策规定,𝕏可能会使用所收集到的平台信息和公开可用的信息,来帮助训练 𝕏 的机器学习或人工智能模型。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >428次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/260.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/214.html"> 荣耀CEO谈华为手机回归:替老同事们高兴,对行业也是好事 </a> </h3> <div class="tp-postitem-summary"> <p> 9月2日,荣耀CEO赵明在采访中谈及华为手机回归时表示,替老同事们高兴,觉得手机行业,由于华为的回归,让竞争充满了更多的可能性和更多的魅力,对行业来说也是件好事。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>423次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/214.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn/img/2023-09-01/ad1699b6ffae6610a2f72bdbe100ae3b"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/1/962.html"> AI操控无人机能力超越人类冠军 </a> </h3> <div class="tp-postitem-summary"> <p> 《自然》30日发表的一篇论文报道了一个名为Swift的人工智能(AI)系统,该系统驾驶无人机的能力可在真实世界中一对一冠军赛里战胜人类对手。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >423次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/1/962.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/openai.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/1/391.html"> AI生成的蘑菇科普书存在可致命错误 </a> </h3> <div class="tp-postitem-summary"> <p> 近日,非营利组织纽约真菌学会(NYMS)发出警告,表示亚马逊为代表的电商平台上,充斥着各种AI生成的蘑菇觅食科普书籍,其中存在诸多错误。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >420次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/1/391.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/elonmask.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/1/452.html"> 社交媒体平台𝕏计划收集用户生物识别数据与工作教育经历 </a> </h3> <div class="tp-postitem-summary"> <p> 社交媒体平台𝕏(原推特)新隐私政策提到:“在您同意的情况下,我们可能出于安全、安保和身份识别目的收集和使用您的生物识别信息。” </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >411次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/1/452.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/178.html"> 国产扫地机器人热销欧洲,国产割草机器人抢占欧洲草坪 </a> </h3> <div class="tp-postitem-summary"> <p> 2023年德国柏林消费电子展上,各大企业都带来了最新的理念和产品,而高端化、本土化的中国产品正在不断吸引欧洲等国际市场的目光。 </p> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span>406次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/178.html" target="_blank">详细内容 »</a> </div> </div> <div style="background-color: #eee;height:1px;margin:0px 0px;"></div> <div class="tp-postitem"> <div class="tp-postitem-thumbnailwrapper"> <img class="tp-postitem-thumbnailimg lazy" data-original="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/images/ent-logo-thumb/apple.jpg"/> </div> <div class="tp-postitem-textwrapper"> <h3 class="tp-postitem-title"> <a target="_blank" class="cleanurl" href="/doc/2023/9/4/268.html"> 罗永浩吐槽iPhone15和14不会有区别,除了序列号变了 </a> </h3> <div class="tp-postitem-summary"> <p> 罗永浩日前在直播中吐槽苹果即将推出的 iPhone 新品,具体内容为:“以我对我‘子公司’的了解,我认为 iPhone 15 跟 iPhone 14 不会有什么区别的,除了序(列)号变了,这个‘不要脸’的东西,这个‘臭厨子’。 </p> </div> </div> <div class="tp-postitem-bottom"> <span>发布于:8月以前</span>  |  <span >398次阅读</span>  |  <a class="cleanurl" href="/doc/2023/9/4/268.html" target="_blank">详细内容 »</a> </div> <div style="clear:both"></div> </div> </div> </div> <div style="height:8px;"></div> </div> <div class="three columns"> <!-- article h5entry --> <div class="sideblock"> <a href="https://m.hellobit.com.cn/doc/day/2018-08-14/10183.html"> <div style="padding:10px 10px 0px 10px;"> <div style="float:left;"> <img style="width:50px;height:50px;" src="/qrcode/aHR0cHM6Ly9tLmhlbGxvYml0LmNvbS5jbi9kb2MvZGF5LzIwMTgtMDgtMTQvMTAxODMuaHRtbA?size=400&margin=0"></img> </div> <div style="float:left;margin-left:10px;"> <p class="headline">扫码在手机上访问</p> <p class="descline">为您提供高质量的文档</p> </div> <div style="clear:both;"></div> </div> </a> </div> <div class="blockgap"></div> <!-- tech list --> <div class="sideblock"> <div class="block-title"><i class="fas fa-chart-line"></i><span> 相关文章</span></div> <div class="block-body"> <div style="border-bottom:1px dashed #eee;padding:8px 0px;"> <a class="urlblockv2 cleanurl" href="/doc/day/2018-09-22/8440.html"> <span class="fa fa-caret-right"></span> Android插件化方案 </a> <span style="font-size: 14px;color: #333;display:inline-block;">5年以前  <span style="color:#ccc;">|</span>  236905次阅读</span> </div> <div style="border-bottom:1px dashed #eee;padding:8px 0px;"> <a class="urlblockv2 cleanurl" href="/doc/2022/12/27/653.html"> <span class="fa fa-caret-right"></span> 前端录屏 + 定位源码,帮你快速定位线上 bug </a> <span style="font-size: 14px;color: #333;display:inline-block;">1年以前  <span style="color:#ccc;">|</span>  27474次阅读</span> </div> <div style="border-bottom:1px dashed #eee;padding:8px 0px;"> <a class="urlblockv2 cleanurl" href="/doc/2020/1/5/861.html"> <span class="fa fa-caret-right"></span> raw.githubusercontent.com被污染的解决办法 </a> <span style="font-size: 14px;color: #333;display:inline-block;">4年以前  <span style="color:#ccc;">|</span>  7473次阅读</span> </div> <div style="border-bottom:1px dashed #eee;padding:8px 0px;"> <a class="urlblockv2 cleanurl" href="/doc/2022/10/19/765.html"> <span class="fa fa-caret-right"></span> vscode超好用的代码书签插件Bookmarks </a> <span style="font-size: 14px;color: #333;display:inline-block;">1年以前  <span style="color:#ccc;">|</span>  7101次阅读</span> </div> <div style="padding:8px;"> <a class="urlblockv2 cleanurl" href="/doc/2021/11/4/389.html"> <span class="fa fa-caret-right"></span> 飞书里面给链接生成一个预览是怎么做到的? </a> <span style="font-size: 14px;color: #333;display:inline-block;">2年以前  <span style="color:#ccc;">|</span>  6737次阅读</span> </div> </div> </div> <div class="blockgap"></div> <!-- article toc, 放最后 --> <div id="toc_panel_all"> <div id="toc_panel"> <div class="sideblock right-menu"> <div class="block-title"><i class="fas fa-stream"></i><span> 目录</span></div> <div class="block-body"> <div id="toc" class="toc-container"></div> </div> </div> <div class="blockgap"></div> </div> <script> function onLoadTocTree(){ tocList(); } </script> <div class="sideblock" style="border-radius: 4px;"> <div class="_d3aes4p30wo" style="width:250px;height:250px;"></div> <script type="text/javascript"> (window.slotbydup = window.slotbydup || []).push({ id: "u1587556", container: "_d3aes4p30wo", async: true }); </script> </div> <div class="blockgap"></div> </div> </div> </div> </div> <br/> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/vendor/jquery/dist/jquery.min.js"></script> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/vendor/jqueryui/jquery-ui-core-widget.min.js"></script> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/vendor/jqueryui/jquery-ui-core-widget.min.js"></script> <link rel="stylesheet" href="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/v6/css/jquery.tocify.css"> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/v6/js/jquery.tocify.js"></script> <link rel="stylesheet" href="/themes/gr/toc/toc.css?ver=20231113"> <script src="/themes/gr/toc/toc.js?ver=20231113"></script> <script> var __isIEMode = false; </script> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/vendor/highlight(11.7)/highlight.min.js"></script> <script src="https://oss-cn-hangzhou.aliyuncs.com/codingsky/cdn1/codingsky/themes/gr/v6/js/lazyload.js"></script> <script src="/themes/gr/js/utils.js?ver=20231113"></script> <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script> <script> var articleID = 30183 function onArticlePageLoaded(){ initArticlePage(); } </script> <div class="suspension-panel suspension-panel"> <button id="back-to-top" title="回到顶部" class="btn to-top-btn" style=""> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class=""><path data-v-01e634ce="" fill-rule="evenodd" clip-rule="evenodd" d="M2.75 1C2.33579 1 2 1.33579 2 1.75C2 2.16421 2.33579 2.5 2.75 2.5H13.25C13.6642 2.5 14 2.16421 14 1.75C14 1.33579 13.6642 1 13.25 1H2.75ZM7.24407 3.87287C7.64284 3.41241 8.35716 3.41241 8.75593 3.87287L13.0622 8.84535C13.6231 9.49299 13.163 10.5 12.3063 10.5H10V14C10 14.5523 9.55228 15 9 15H7C6.44772 15 6 14.5523 6 14V10.5H3.69371C2.83696 10.5 2.37691 9.49299 2.93778 8.84535L7.24407 3.87287Z" fill="#8A919F"></path></svg> </button> <button title="建议反馈" class="btn meiqia-btn" style=""> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="icon-feedback"><path data-v-01e634ce="" fill-rule="evenodd" clip-rule="evenodd" d="M1.8252 4.002C1.8252 2.80032 2.79935 1.82617 4.00102 1.82617H12.001C13.2027 1.82617 14.1768 2.80032 14.1768 4.002V9.71628C14.1768 10.918 13.2027 11.8921 12.001 11.8921H9.43308L6.92709 14.1281C6.4455 14.5578 5.68234 14.216 5.68234 13.5706V11.8921H4.00102C2.79934 11.8921 1.8252 10.918 1.8252 9.71628V4.002ZM11.2414 7.86753C11.3826 7.65526 11.3249 7.36878 11.1126 7.22764C10.9004 7.08651 10.6139 7.14417 10.4728 7.35643C9.94042 8.15705 9.03153 8.68309 7.99997 8.68309C6.96841 8.68309 6.05952 8.15705 5.52719 7.35643C5.38605 7.14417 5.09957 7.08651 4.88731 7.22764C4.67504 7.36878 4.61738 7.65526 4.75852 7.86753C5.45467 8.91452 6.64645 9.60617 7.99997 9.60617C9.35349 9.60617 10.5453 8.91452 11.2414 7.86753Z" fill="#1E80FF"></path></svg> </button> </div> <script> setTimeout(function(){ var btn = document.getElementById('back-to-top'); if(btn != null){ btn.onclick = function(){ $('body,html').animate({scrollTop:0},300) } } },1000) function initPageAfterCheckToken(){ if(typeof onInitSnippetPage === "function"){ onInitSnippetPage(); } if(typeof onInitSnippetViewPage === "function"){ onInitSnippetViewPage(); } if(typeof onArticlePageLoaded === "function"){ onArticlePageLoaded(); } if(typeof onLoadTocTree === "function"){ onLoadTocTree(); } if(typeof onInitBulmaDialog === "function"){ onInitBulmaDialog(); } } $(document).ready(function(){ initCurrentAuthUser(function(){ if(isLogined()){ $("#login-nav-menu").hide(); //$("#login-nav-menu").text("登录"); //$("#register-nav-menu").hide(); //$("#register-nav-menu").text("注册"); $("#userinfo-nav-menu").show(); $("#username-label").text(getDisplayName()); }else{ $("#login-nav-menu").show(); $("#userinfo-nav-menu").hide(); $("#userinfo-nav-menu-link").hide(); } initPageAfterCheckToken(); }); $('img.lazy').lazyload(); if(typeof wechatShareArticle === "function"){ wechatShareArticle(); } if(__isIEMode){ hljs.initHighlighting(); }else{ hljs.highlightAll(); } if(typeof onInitBookContentPage === "function"){ onInitBookContentPage(); } if(typeof onInitSearchPage === "function"){ onInitSearchPage(); } // 主界面右侧菜单点击 /*$('#userinfo-nav-menu').click(function(){ $("#dropMenuWrapper").toggle(); });*/ }); $(document).click(function(event){ var navMenuIds = ["userinfo-nav-menu","username-label","username-label-caret"] var eventId = $(event.target).attr("id"); var arrIndex = navMenuIds.indexOf(eventId); if(arrIndex >= 0){ return; } $("#dropMenuWrapper").hide(); }); </script> <div class="modal"> <div class="modal-background"></div> <div class="modal-card-body"> <ul> <li>收藏文章</li> </ul> </div> <button class="button">暂不登录</button> <a href="/user/login" class="button is-primary">去登录</a> </div> <div id="toLoginDialogGuide" class="modal"> <div class="modal-background"></div> <div class="modal-content" style="background-color:#fff;padding:22px 22px 22px 22px;width:400px;"> <h3>登录后可以享受更多权益</h3> <ul style="display:flex;justify-content: space-between;flex-wrap: wrap;flex-direction: row;"> <li class="login-guide-list-item"> <span class="icon-text"><span class="icon" style="color:#3472F7;"><i class="fab fa-dochub"></i></span><span>收藏有用的文章</span></span> </li> <li class="login-guide-list-item"> <span class="icon-text"><span class="icon" style="color:#3472F7;"><i class="fab fa-codepen"></i></span><span>整理自己的代码</span></span> </li> <li class="login-guide-list-item"> <span class="icon-text"><span class="icon" style="color:#3472F7;"><i class="fas fa-history"></i></span><span>查阅浏览足迹</span></span> </li> <li class="login-guide-list-item"> <span class="icon-text"><span class="icon" style="color:#3472F7;"><i class="fas fa-exchange-alt"></i></span><span>多个平台共享账号</span></span> </li> </ul> <a href="/user/login" style="width:100%;" class="button is-primary">去登录</a> <p>首次使用?从这里 <a href="/user/login" class="cleanurl">注册</a></p> </div> </div> <!-- baidu union --> <script type="text/javascript" src="//cpro.baidustatic.com/cpro/ui/c.js" async="async" defer="defer" ></script> <!-- Global site tag (gtag.js) - Google Analytics <script async src="https://www.googletagmanager.com/gtag/js?id=UA-108792812-1"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-108792812-1'); </script> --> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?713c92a31aa12d55b910e2065c7cda9d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script> /*var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?e066867ae5a323a82641e57db7e7c914"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();*/ </script> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=66376258" charset="UTF-8"></script> --> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-2VE3RBLF6N"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-2VE3RBLF6N'); </script> </body> </html>