Java: splitting a comma-separated string but ignoring commas in quotes

前端 未结 11 1532
广开言路
广开言路 2020-11-21 05:16

I have a string vaguely like this:

foo,bar,c;qual=\"baz,blurb\",d;junk=\"quux,syzygy\"

that I want to split by commas -- but I need to igno

11条回答
  •  北海茫月
    2020-11-21 06:12

    Try a lookaround like (?!\"),(?!\"). This should match , that are not surrounded by ".

提交回复
热议问题