If you really want to make your own templating system check out HTML::Parser. In it is a subclass called HTML::TokeParser (if I remember correctly) that will cleanly separate all the HTML tags so can just iterate over them with a foreach loop and not have to worry about spacing and the like.
Regex's to match HTML type tags can be pretty tricky. I'd be tempted to go with a pre-built package that already works correctly.
/\/\averick
In reply to Re: Regex and HTML Question
by maverick
in thread Regex and HTML Question
by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |