in reply to regex in perl

Is there a reason you don't want to use a proper parser, specifically designed for this task, and the other tasks you're trying to achieve?

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.