in reply to automating superscripting in HTML

Can any of you wizards suggest a perl program that takes [NN] and subs: "<SUB><A HREF="NN"><B>FONT  SIZE="-3"><B> NN &nbsp;</FONT></B></SUB>

Is this a trick question? What's wrong with the obvious solution?

s![[](\d+)[]]!<sup class="footnotemark"><a href="#$1"><strong>$1</strong></sup>!g;

What have you tried? What is wrong with the results?


Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.

Replies are listed 'Best First'.
Re^2: automating superscripting in HTML
by kline (Initiate) on Mar 22, 2006 at 21:23 UTC
    Not a trick question; and the solution that's obvious to you, wasn't so obvious to me. The regex you've got with the backets was a stumbling point.... maybe the only one.

    Besides the on-page footnote pointers, there are at least 8 pages of index listing that have to point to the appropriate page. I may be able to use your solution there too, thanks.