简体   繁体   中英

Parser bracket regex

I'm copletly noob of regex, but i'm forced to use it.

I've tried to read other topics about regex butI still have some questios

I have string like this:

a(b(c))d

And I'd like it after while loop to show me something like this:

c
b(c)

I've tried to work with

Regex r = new Regex("/{\"(:\":\"(.*?)\")/");

But it did't work at all

Also can you please recomend me any tutorial or book from where can I lear about regular expressions?

Thanks in advance Radek

If you want to learn more about regular expressions, head to http://www.regular-expressions.info/

Regular expressions and parsing have a crippled relationship at best when dealing with nested content.

Since the pattern you are looking at could go arbitrarily deep, you would need something that can understand the placement of each bracket.

If you are using regular expressions to do this than I would suggest first going over some tutorials, like This

In addition, it looks like you are trying to match any parameters within a string, in that case I would suggest reading This Article which describes what looks like a similar scenario.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM