开发者

regular expression which should not allow exe file format upload

i have this file upload control which uploads all kinds o f fi开发者_如何学Pythonles. i have to restrict it in such a way that it should not allow exe formats..could anyone please help me with this..i cannot enter allowed file formats as it is unpredictable ..i need to restrict only exe format ..thanks in advance


You can use the regex:

^(?!.*\.exe$).*$

Rubular Link


This regex would match a string beginning with any characters ('^.*') and ending in ".exe" ('\.exe$'):

^(.*\.exe)$

Tested it here: http://www.regexplanet.com/simple/index.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜