It seems like you've asked several questions about parsing these files, so I'd suggest that it's time to start learning to use a proper parser for the task. Reading back on some of your previous posts, I notice that toolic already pointed you at the Verilog-Perl package.
While searching http://cpan.org I notice that there are more projects for Verilog than I'd've guessed. I'd suggest installing the Verilog-Perl package, and reviewing the scripts it comes with (vhier, etc.) and see if any of them would make a good starting point for turning into the program you want.
If you continue to work with Verilog files, you'll probably find that you'll start hitting the limits of what you'll be able to do reliably with regular expressions.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: how to extract multiple pattern into array
by roboticus
in thread how to extract multiple pattern into array
by herman4016
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |