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,271
  • 2
  • 17
  • 40

1 Answers1

0

You can try with this one:

/([^\/]+)/g

Tested here:

Regex101

Mustofa Rizwan
  • 10,009
  • 2
  • 25
  • 42