0

I want to split a string by comma, space and quetes. for example:

Input:

"Super Bus" dri"ver bus1, driver1

output:

"Super Bus"
dri"ver
bus1
driver1

This is my regex(it splits by space and comme):

Text.RegularExpressions.Regex("[ ,]+")

Any help appreciated!

Alon Shmiel
  • 6,333
  • 19
  • 88
  • 134

1 Answers1

2

I suggest you to do matching instead of splitting.

[^,\s]*\b"\b[^,\s]*|"[^"]*"|[^,\s]+

DEMO

Avinash Raj
  • 166,785
  • 24
  • 204
  • 249