How can I recursively match a pattern using Regular Expressions?

后端 未结 5 1831
小蘑菇
小蘑菇 2020-12-04 01:36

The string can be like one of the following:

a(b,c)
a(a(b,c),d)
a(a(a(a(a(b,c),d),a(e,f)),g),h)
etc

I want to match an unlimited number of

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 02:09

    2 options - 1) Use Lexical Analysis to do the pattern matching & replacement on your own [OR] 2) If you want to stick to Regex then use some shell programming (or any supporting language) & call it from Java.

提交回复
热议问题