I need to match a string with alphanumeric, underscores and dashes only followed by one or zero forward slash only.
These are valid:
aBc
ab-9/
a_C-c/
3-b-c
These are invalid:
aBc/xyz
1bc/x7z/
hello//
a-b_/89u/13P
I am trying this:
([a-zA-Z0-9-_]{1,})(?=\\?)
But it is not working. It is still matching, for example, this: a-b_/89u/
Please help