here are my possible matching cases
/aaa
/aaa/
/aaa/bbb
/aaa/bbb/
/aaa/bbb/ccc
/aaa/bbb/ccc/
I'm trying to catch aaa
, bbb
and ccc
if available
I know or sure aaa
is there, so the regex can be /(aaa)/([^/]*)...
I tried a few other scenarios to catch the rest of the words after slash, non-greedy /([^/]+)
, /([^/].+?)
, (/[^/].+?)
, (?:/(.*))
but they don't match all cases.
Any ideas?
One can test here enter link description here