On Wednesday, 11 April 2012 22:25:26 UTC-3, Ronald J Kimball wrote: > > If you'd rather insert the numbers into the HTML, you would need a script > > of some kind. Here's a simple one in Perl, which also replaces existing > numbering, if any: > > #!perl -p > s/(<dt[^>]*>)(\d+\. )?/$1 . ++$i . ". "/ige; >
I have a similar problem but have no experienece with PERL, so I'm finding it difficult to modify this bit of code to suit. In my case I have a series of lines like this... <..the start of an href here..>[+]</a> <..the start of an href here..>[+]</a> ... and I want to replace each of the plus signs with a sequential number, starting with 1, so they end up like this... <..the start of an href here..>[1]</a> <..the start of an href here..>[2]</a> There are about 40 altogether, so more than one digit is required for most of them. With only 40 I could, of course, do it manually, but I'd learn nothing from that. How would PERL handle this? Thanks, Rob -- You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at <http://groups.google.com/group/bbedit?hl=en> If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
