in reply to Maintaining horrible C with Parse::RecDescent
His suggestion of /^[A-Z_]+ [a-z_0-9]+ = {/ will probably catch too much (i'm guessing you have plenty of small arrays you aren't worried about) but if there's some "minimum array nest depth" that you are interested in, you can write a regexp to find those...
(completely untested,of course)$_ = ...; # file contents my $min_depth = 4; while (/([A-Z_]+ [a-z_0-9]+ = \{([^\}]*\{){$min_depth,}[^;]*;)/g) { my $array = $1; .... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Maintaining horrible C with Parse::RecDescent
by RMGir (Prior) on Mar 18, 2002 at 12:43 UTC |