split string on comma, but not commas inside parenthesis

后端 未结 3 2037
没有蜡笔的小新
没有蜡笔的小新 2021-01-23 23:09

Now I have a task about Java IO , I need to read file line by line and save this data into database, But Now I got a problem.

\"desk\",\"12\",\"15\",\"(small         


        
3条回答
  •  广开言路
    2021-01-23 23:37

    (\(.+?\)|\w+)
    

    the code above matches the result below this will allow for a more flexible solution that some of the other posted ones. The syntax for the regular expression is in another answer on this page just use this regular expression instead

    desk
    12
    15
    (small,median,large)

提交回复
热议问题