Reputation:
What would be the php regex to match any one of the following:
privacy.html privacy.htm privacy w3c/privacy.html w3c/privacy.htm w3c/privacy
thanks
JP
Upvotes: 0
Views: 1213
Reputation: 2069
Try
(w3c/)?privacy(.htm(l)?)?
10char
Upvotes: 1
Reputation: 74272
This should work: ^[^\/]+(?:\/[^\/]+)?$
^[^\/]+(?:\/[^\/]+)?$