I want a regular expression, which should start with alphabet or numbers and followed by alphanumeric character and in between, it may or may not contain forward or backward slash (\,/).
Highly appreciate your help.
Thanks :)
I want a regular expression, which should start with alphabet or numbers and followed by alphanumeric character and in between, it may or may not contain forward or backward slash (\,/).
Highly appreciate your help.
Thanks :)
/^[a-z0-9][\w\\\/]+$/i
^).[a-z0-9] - a letter or number - 1 occurrence[\w\\\/]+ - multiple occurrences of alphanumeric characters (including _) or \ or /.$).ignore-case flag will accept both uppercase and lowercase.
[xyz] specifies a character class meaning that either x or y or z can be matched.
If you don't consider 123_asd to be alpha-numeric, use:
/^[a-z0-9][a-z0-9\\\/]+$/i
Hope it helps!
^[a-zA-Z0-9]+[a-zA-Z0-9\/\\]*
This will accept / or \ only in between.
Edit: Oops:p Missed the numbers, updated. Thanks for pointing out.