javascript regex for string starting with forward slash followed by alphanum chars and no space
The regex you need is:
/^\/[a-z0-9]+$/i
i.e.:
^
- anchor the start of the string\/
- a literal forward slash, escaped[a-z0-9]+
- 1 or more letters or digits. You can also use\d
instead of0-9
$
- up to the end of the string/i
- case independent
This should do it. This takes a-z and A-Z and 0-9.
/^\/[a-z0-9]+$/i
Image from Regexper.com