in reply to need a regular exdpression in perl
What code have you written and where do you have problems with it?
How does your code fail?
Have you looked at using one of the established template modules instead of rolling your own template?