开发者

PHP Regex for file/path

What would be the php regex to match any one of the following:

privacy.html
pri开发者_如何学运维vacy.htm
privacy
w3c/privacy.html
w3c/privacy.htm
w3c/privacy

thanks

JP


Try

(w3c/)?privacy(.htm(l)?)?

10char


This should work: ^[^\/]+(?:\/[^\/]+)?$

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜