I have a regular expression which processes a URL with all alphanumeric chars including -
and _
. I would like to add an exception, so it will not process the URLs /basic
and /advance
/?([a-zA-Z0-9_-]+)?/?([a-zA-Z0-9_-]+)?/?([0-9_-]+)?
It should process everything above, except the words "basic" and "advance".
How can I add an exception in above regular expression.
I tried to do something below but it did not work.
/?([a-zA-Z0-9_-]+^(?!basic) ^(?!advance))?/?([a-zA-Z0-9_-]+)?/?([0-9_-]+)?
Any ideas?
I used following link for guide line.
String negation using regular expressions
Regular Expressions and negating a whole character group
What is a non-capturing group? What does a question mark followed by a colon (?:) mean?