0

UPDATE: actually if I want to match "-" I have to use - when there is something after -

All:

Why in this example:

var a = "Pencil_sharper.pdf"
a.split(/[. -_]+/g)
(4) ["", "encil", "sharper", "pdf"]

I expected

["Pencil", "sharper", "pdf"]
Kuan
  • 10,615
  • 22
  • 82
  • 183

0 Answers0