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,753
  • 23
  • 90
  • 138

1 Answers1

2

I suggest you to do matching instead of splitting.

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

DEMO

Avinash Raj
  • 172,303
  • 28
  • 230
  • 274