in reply to A Question on Regex

I need to parse a hardware code

Use a hardware code parser? Surely you're not the first to need to parse such a thing , whatever it is :)

If you know the name, search cpan or sourceforge (even google) for a parser

The coding has new-lines in between those statements, However I want them to be chosen too.

Then you will have to read more than one line at a time, keep track of lines ... see the replies to String Search for some ways ( esp Re: String Search,Re^5: String Search )

Also , your sample data doesn't reflect this requirement, see How do I post a question effectively?