当前位置:网站首页>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 .
边栏推荐
- 13. Hash table - the first common node of two linked lists
- 中芯国际科创板IPO顺利过会,市值有望突破2000亿!
- Vulnerability analysis hevd-0x8.integeroverflow[win7x86]
- 数据库mysql基础
- 印度计划禁用中国电信设备!真离得开华为、中兴?
- LIBCMTD.lib
- Install MySQL under centos7, and the online articles are not accurate
- leetcode——旋转数组的最小数字
- 2. 输出数组中重复的数字之一
- Guangzhou metro line 14 xinshixu station is under construction, and residents in Baiyun District are about to start a double line transfer mode!
猜你喜欢

Digital transformation scheme of real estate: all-round digital intelligence system operation, helping real estate enterprises improve the effectiveness of management and control

ADVANCE.AI出海指南助力企业出海印尼,掌握东南亚市场半边天

5、动态规划---斐波那契数列

SuperMap iServer发布管理以及调用地图服务

It's settled! On July 30!

6、双指针——递增数组两数之和与目标数相等

IDEA打包jar包及运行jar包命令

Aqua Data Studio 18.5.0导出insert语句

Performance test of API gateway APIs IX in Google cloud T2a and T2D

PHP生成二维码(学习)
随机推荐
jvm原理
不登高山,不知天之高也;不临深溪,不知地之厚也
利用正则表达式从文件路径中匹配文件名
Database mysql Foundation
Vulnerability analysis hevd-0x8.integeroverflow[win7x86]
漏洞分析丨HEVD-0x8.IntegerOverflow[win7x86]
海量数据TopN问题
PHP generates QR code (learning)
Status Notice ¶
Lucene 查询语法备忘
2. 输出数组中重复的数字之一
15. Judge whether the target value exists in the two-dimensional array
14、双指针——盛最多水的容器
uni-app进阶之创建组件/原生渲染
4. Adjust the array order so that odd numbers precede even numbers
Why should I take the first-class constructor examination? How high is the gold content of the first-class Constructor Certificate?
5、动态规划---斐波那契数列
问题总结档案
6、双指针——递增数组两数之和与目标数相等
PHP生成二维码(学习)
