当前位置:网站首页>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 .
边栏推荐
猜你喜欢

14. Double pointer - the container that holds the most water

SuperMap iserver publishing management and calling map services

It's settled! On July 30!

多线程与高并发(三)—— 源码解析 AQS 原理

Get to know SuperMap idesktop for the first time

11. Linked list inversion

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

15、判断二维数组中是否存在目标值

Choosing a supplier service system is the first step for large health industry enterprises to move towards digital transformation

What are the advantages of MRO purchasing website for industrial products? One article will help you understand
随机推荐
7、二分法——寻找一组重复或者有序但是旋转的数组
ADVANCE.AI出海指南助力企业出海印尼,掌握东南亚市场半边天
ogg参数filter的使用问题【急】
brief introduction
【微信小程序】项目实战—抽签应用
7. Dichotomy -- find a set of repeated or ordered but rotating arrays
Uni app advanced creation component / native rendering
string matching
初识SuperMap iDesktop
6、双指针——递增数组两数之和与目标数相等
中芯国际科创板IPO顺利过会,市值有望突破2000亿!
双指针技巧
基于ModelArts续写最伟大的作品【玩转华为云】
14. Double pointer - the container that holds the most water
基于docker安装MySQL
SuperMap iServer发布管理以及调用地图服务
Voice chat app - how to standardize the development process?
16、字符串反转
漏洞分析丨HEVD-0x8.IntegerOverflow[win7x86]
PL/SQL server语法详解
