Regular expression for valid filename

后端 未结 10 1563
被撕碎了的回忆
被撕碎了的回忆 2020-12-29 18:11

I already gone through some question in StackOverflow regarding this but nothing helped much in my case.

I want to restrict the user to provide a filename that shoul

10条回答
  •  粉色の甜心
    2020-12-29 19:08

    I've just created this. It prevents two dots and dot at end and beginning. It doesn't allow any two dots though.

    ^([a-zA-Z0-9_]+)\.(?!\.)([a-zA-Z0-9]{1,5})(?

提交回复
热议问题