0

Suppose the file path is "a/b/c/d/e", how can I get a array of 'a', 'b', 'c', 'd', 'e'?
I have consider with this: (?:(.+)/)*?(.+)
but it get empty string,it is really unexpected.

LoranceChen
  • 2,453
  • 2
  • 22
  • 48

1 Answers1

0

You can try with this one:

/([^\/]+)/g

Tested here:

Regex101

Mustofa Rizwan
  • 10,215
  • 2
  • 28
  • 43