I have the regular expression
[/].([a-z/!@$%^&*()-+><~*\.]+)
which I am trying to capture everything after the / (inclusive) up to a # or ? (exclusive).
The strings I have tried the regex on:
/hello.there#test properly gives me the /hello.there
however trying it on just / does not group anything. It does not group anything in the string /h as well. I thought it would do it for that because I included a-z in the set to capture.
How can I improve the regex so that it captures / (inclusive) and everything after excluding # and ? while ignoring anything after # and ?
Thank you
(\/[^#\?]+)?/hello/there#testor if the string doesn't have a#?