C:\test>perl -nE"my$t; /{/&&++$t or /}/&&--$t for split''; say $t ? $t
+ : 'good string'"
{}
good string
{}}
-1
{{}}
good string
{{}{}}
good string
{{}{}}}
-1
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
11
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}
14
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}
6
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}
good string
But I wouldn't call it RDP :)
The problem with doing RDP with regex is that you have to match the entire stream with one (possibly (hopefully :) composite) regex. Which is fine for yes/no booleans, but it makes both debugging the regex and reporting where and why parsing errors occur extremely messy if not impossible.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP Neil Armstrong
|