Java splitting a string while ignoring any delimiters between brackets

后端 未结 1 626
攒了一身酷
攒了一身酷 2021-01-23 17:23

I\'m looking for java regex to split the inputString while ignoring delimiters between brackets/multiple brackets.

Java code:

Pattern p = Pattern.compile         


        
相关标签:
1条回答
  • 2021-01-23 17:51

    That's not possible using regular expressions.

    The expression would have to match strings with balanced brackets. (Which is not a regular language.)

    You need to use some other parsing technique or do it manually by counting { and }.

    0 讨论(0)
提交回复
热议问题