This topic created in 4356 days ago, the information mentioned may be changed or developed.
PHP
扩展名为 .doc 或 .docx
文件名部分为任意字符
example
[2013级期末考试试题.doc] 只匹配 [2013级期末考试试题] 部分
4 replies • 2014-12-06 21:04:08 +08:00
 |
|
\[(.+)\.[^\.]+ 由于给出的例子不具代表性,这个正则不通用
|
 |
|
str_replace(strrchr($FileName, '.'),"",$FileName) 正则效率低,不过这种会去除所有.doc
|
 |
|
按照.doc
|
 |
|
以.doc为关键词转换为数组,然后提取出来就行了...
|