Python 正则表达式提取UNC路径中的server和share
来源:互联网 发布:御姐控 知乎 编辑:程序博客网 时间:2024/06/07 07:24
1. Regular Expression^\\\\([a-zA-Z0-9_.$ -]+)\\([a-zA-Z0-9_.$ -]+)eg.\\server\share\folder\file.ext2. Python codeimport resubject = '\\\\server\\share\\folder\\file.ext'match = re.search(r"\\\\([a-zA-Z0-9_.$ -]+)\\([a-zA-Z0-9_.$ -]+)", subject)if match: server = match.group(1) share = match.group(2) print 'server:', server print 'share:', shareelse: print 'Invalid URL!'
0 0
- Python 正则表达式提取UNC路径中的server和share
- python正则表达式提取文本中的电话号码和邮箱
- Python 正则表达式提取URL中的Scheme
- Python 正则表达式提取URL中的USER
- Python 正则表达式提取URL中的Host
- Python 正则表达式提取URL中的Path
- Python 正则表达式提取URL中的Query
- Python 正则表达式提取URL中的Fragment
- Python 正则表达式提取Windows路径中文件名
- python正则表达式,提取命中mongo中的数据
- UNC路径和终端服务
- python爬虫提取信息:正则表达式和xpath
- python requests 和正则表达式提取贴吧图片
- 正则表达式提取URL中的文件名和替换
- 用HttpWebRequest和正则表达式提取网页中的链接
- python正则表达式中的match 和 search
- Python中的re模块和正则表达式
- python 中的正则表达式
- Apache Commons(http://commons.apache.org/)
- QT中中文路径无法识别的解决方法
- IOS产品养成记-前言
- 为你的钱找到一份好工作了吗?
- PHP proc_open详解
- Python 正则表达式提取UNC路径中的server和share
- 在HDInsight中从Hadoop的兼容BLOB存储查询大数据的分析
- 各种基金调用介绍
- file_get_contents 多参数
- 超详细mysql left join,right join,inner join用法分析
- 如何阅读别人的代码 [原]
- 黄金数据查询演示示例
- Juniper NetScreen防火墙DoS攻击的检测和防御
- GITHUN ANdroid lib