Parse commas not surrounded by brackets

后端 未结 2 784
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-25 16:18

The input is a comma-separated list of fields.

Here is an example.

tna,performance,ma[performance,3],price

The issue is that some of t

相关标签:
2条回答
  • 2021-01-25 16:47

    This is what you need

    (?<!\[[\w,]*?),
    

    If brackets are nested within brackets, use this because the above would fail in that scenario..

    (?<!\[[\w,]*?),(?![\w,]*?\])
    

    works here

    0 讨论(0)
  • 2021-01-25 16:58

    Try this :

    "[a-z0-9]*(\\[[a-z0-9\\[\\],]+\\])*"
    
    0 讨论(0)
提交回复
热议问题