I have a suspicion that what you want to do is to fill a template.. in which case, rather than roll your own solution, you should check CPAN - there's a lot of modules that do a very good job of this:
Of course, do give the solutions you got from the others a whirl to learn some more about regexen. :-) But for actually solving the task at hand the modules will do a better job in every aspect than a solution that you might write in a sane amount of time would. As a bonus, the "larger" ones of them offer a lot of power, so that you won't "grow out of" them anytime soon. (In fact I don't think one can grow out of TT2 at all..)
See perrin's templating system roundup at Perl.com for some of the whys and a more detailed "tour" around some of these modules.Makeshifts last the longest.
In reply to Re: Sequential Replacement
by Aristotle
in thread Sequential Replacement
by cidaris
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |