当前位置:网站首页>Match file names from file paths using regular expressions
Match file names from file paths using regular expressions
2022-07-28 10:21:00 【Java code farmer Lao Wang】
The first one is , The file name does not contain an extension :
Regular expression writing :([^<>/\\\|:""\*\?]+)\.\w+$java Writing in Chinese :
…… String reg = "([^<>/\\\\|:\"\"\\*\\?]+)\\.\\w+$+"; Matcher m = Pattern.compile(reg).matcher(uri); //uri For the path that needs to be matched Sring filename = null; if (m.find()) { filename = m.group(1); } ……Example :
The second kind : The file name contains the extension
Regular expression writing :([^<>/\\\|:""\*\?]+\.\w+$)explain : The two matching rules are compatible windows and linux System .
边栏推荐
- Database mysql Foundation
- MySQL架构原理
- 不登高山,不知天之高也;不临深溪,不知地之厚也
- 问题总结档案
- Etcd(高可用KV数据库)
- 基于docker安装MySQL
- Go 内存模型 (2014年5月31日版本)
- B2B e-commerce website scheme for building materials industry: enable the transformation and upgrading of building materials enterprises to achieve cost reduction and efficiency improvement
- Massive data topn problem
- brief introduction
猜你喜欢

PHP生成二维码(学习)

It's settled! On July 30!

6. Double pointer -- the sum of the two numbers of the incremental array is equal to the target number

IDEA创建我的第一个项目

7. Dichotomy -- find a set of repeated or ordered but rotating arrays

Why should I take the first-class constructor examination? How high is the gold content of the first-class Constructor Certificate?

What kind of knowledge payment system functions are more conducive to the development of the platform and lecturers?

Aqua Data Studio 18.5.0导出insert语句

Skillfully use NGX_ Lua makes traffic grouping

Sword finger offer
随机推荐
Record a parent-child project in idea, modify the name of project and module, and test it personally!
11. Linked list inversion
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
[cloud co creation] enterprise digital transformation, Huawei cloud consulting is with you
ELK实时日志分析平台
银行入职考试要点汇总
Install MySQL under centos7, and the online articles are not accurate
胡润发布2020中国芯片设计10强民营企业:华为海思竟然没有上榜!
谈谈基于JS实现阻止别人调试通过控制台调试网站的问题
Sword finger offer
死锁算法:银行家算法和安全性算法
select如果不加order by子句,返回结果的顺序是不可靠的
Redis design specification
【云驻共创】企业数字化转型,华为云咨询与你同行
[cloud based co creation] Huawei cloud: metastudio digital content production line, which seamlessly integrates the virtual world with the real world
4.调整数组顺序使奇数位于偶数前面
Uni app advanced creation component / native rendering
Status Notice ¶
发力大核、独显!英众科技2020十代酷睿独显产品发布
02.1.2.逻辑类型 bool
