文件名的正则表达式公式 [英] Regex formula for a file name

查看:707
本文介绍了文件名的正则表达式公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望以一种形式允许我只允许接受文件名的字段.文件名看起来像这样:

I would like to allow a field in a form I have to allow only file names to be accepted. File names looks like this:

431714620407606949.jpg

18位[点] jpg/gif/ico/png/tiff

18 digits [dot] jpg/gif/ico/png/tiff

我也希望该字段接受多个文件名条目,所以我希望它像这样:

Also I would like the field to accept multiple file name entries, so I want it to be like this:

431714620407606949.jpg,431714620407674859.jpg,837593620407606949.jpg

推荐答案

应该这样做: http://regexr.com ?353i8 (/([\d]{18}\.)(jpg|png|gif)/g)

该网站将帮助您使用正则表达式'

This site will help you with your regex'

这篇关于文件名的正则表达式公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆