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
  • 11,149
  • 23
  • 93
  • 201

0 Answers0