in reply to Re^2: Perl regex limitations (32k)
in thread Perl regex limitations

Thanks for all the replies! I tried adding the following test to see if I can get it working (as I said, I have now rewritten it to do the parsing by hand, but I would like to figure it out for next time):
$braces = qr/(?<braces>\{ ([^\{\}]++ | (?&braces))*+ \} )/x; if ($h =~ s/class \s+ (?<class_name> \w+) \s* (\: (\s* \w*)? \s* (?<an +cestor> \w+))? \s* $braces//x) { print "hi\n"; }
The match is never made however... The code I'm matching against is a C++ header file, and I'm looking for class definitions, formatted like this :
class MyClassName : public MyAncestorClass { ... ... };
This expression works fine for smaller classes or for this same problem class if there are no braces inside the class definition. In this class however, I have the following declarations (C++ Builder code...) :
__property TNotifyEvent OnMonaDocSaveToDB = {read=FOnMonaDocSaveToDB +, write=FOnMonaDocSaveToDB};
If I remove that property declaration, it matches, if I leave it, it fails... Jonathan