perl regex help request... .

Gary Kline kline at tao.thought.org
Wed Mar 22 23:18:26 UTC 2006


	Guys,

	perlmonks was helpful in explaining that "[[](\d+)[]]" is
	what is required to match [NN].   So that will catch the 
	footnote numbers.  I had thought that I would have to do the
	<A NAME="NN"> NN xyz </A> anchor by hand.   Maybe not, if
	somebody can clue me in on the perl regex for matching

	"NN plus any/every character following until \n"

	I can't find my regex book, and am not exactly clear if this
	will work, but if I go back over my files and insert braces 
	around each note (at the page bottom) like:

	{14, DEWEY AND TUFTS, *Ethics*, pp 345-7, &sect; 4 }

	would this:

	s/{(\d+)}(.+)/

	capture the "14" plus  the rest on the bracketed line?  The 
	HTML would be (methinks):

	<A NAME="14">14, DEWEY AND TUFTS, *Ethics*, pp 345-7, &sect; 4 </A>

	with the $1 capturing the 14 and $2 capturing the rest?

	The entire s//g expr would be::

	s/{(\d+)}(.+)/<A NAME="$1> $1 $2 </A>

	If this is right, I'll be very pleased with myself; else I'm
	hoping that somebody can clue me in.

	gary







-- 
   Gary Kline     kline at thought.org   www.thought.org     Public service Unix



More information about the freebsd-questions mailing list