开发者

ColdFusion REGEX - to determine the file's extension

I'm looking for a REGEX to obtain a files extension.

Given examples like:

modocument.doc
modocument.docx
dasddsa.pdf
kdsksdklsadklasdklads.png
ads123.jpg

I need a REGEX that provides the 3-4 char extension, but isn't fooled 开发者_开发技巧by things like:

asdadsasdads.jpg.png

And only gets PNG as seen above.


I think ListLast would do a better job for you:

<cfset FileExt=ListLast(YourFilename,".")>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜