Welcome to the Monastery | |
PerlMonks |
Search for consecutive flush left curly bracesby ExReg (Priest) |
on Jun 10, 2015 at 14:27 UTC ( [id://1129866]=perlquestion: print w/replies, xml ) | Need Help?? |
ExReg has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a tool to pick apart and analyze C++ files with lots of regexes. I have been slurping in the files and then splitting apart the functions by using split on \n\} . (Functions normally start with a flush left { and end with a flush left }). I found one file where there were two flush left }'s before the next flush right {. I am trying to figure out a way to search for this.
What regex can I use to search for where a \n\} is followed later by another \n\} without a \n\{ in between? I've tried to think of look ahead, look behind, both positive and negative, and can't come up with anything. Any wisdom would be appreciated.
Back to
Seekers of Perl Wisdom
|
|