Regular Expressions 101

Community Patterns

文件名称验证

1

Regular Expression
Java 8

"
^(?!.*((^\.)|(^\s)|(\.$)|(\s$)|[\x00-\x1F\x7F<>:\"\/\\|?*]|((?i)^CON$|^PRN$|^AUX$|^NUL$|^COM[0-9]$|^COM[\u00B9\u00B2\u00B3]$|^LPT[0-9]$|^LPT[\u00B9\u00B2\u00B3]$))).*$
"
mg

Description

操作系统文件名称验证,参考了Windows,Linux,Mac

Submitted by 腾龙问天 - 4 months ago