In this question I asked for a regex to turn /abc/def/ghi
into {/abc/def/ghi
, /def/ghi
, /ghi
}. The answer was to use lookahead with the expression (?=(/.*))
.
Is there a regex to capture from the same string {/abc
, /abc/def
, /abc/def/ghi
}? (Order is not important.)