Regex to Find URLs with only one slash -


i testing website , need target pages want include in test regex.

i targeting product pages have 1 slash in url (the urls not show http:// in them).

here urls need match:

the ones want www.mysite.com/just-on-slash

the ones don't want this: www.mysite.com/more-than-one/slash www.mysite.com

this should work case: ^[^/]+/?[^/]+$

for answer generic, trailing slash need /? @ end, this: ^[^/]+/?[^/]+/?$


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -