Javascript Regex: how to remove string before > and including >

Posted by Kim Jong Woo on Stack Overflow See other posts from Stack Overflow or by Kim Jong Woo
Published on 2011-01-12T03:44:21Z Indexed on 2011/01/12 3:53 UTC
Read the original article Hit count: 173

Filed under:
|

I have a string like so

item[3]>something>another>more[1]>here
hey>this>is>something>new
.
.
.

I would like to produce the following for each iteration indicated by each new line

item[3]>something>another>more[1]>here
something>another>more[1]>here
another>more[1]>here
more[1]>here
here

Another example:

hey>this>is>something>new
this>is>something>new
is>something>new
something>new
new

I would like a regex or some way to incrementally remove the furthest left string up to >.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex