Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2006 15:18:23 -0800
From:      Gary Kline <kline@tao.thought.org>
To:        FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG>
Subject:   perl regex help request... .
Message-ID:  <20060322231823.GA23486@thought.org>

next in thread | raw e-mail | index | archive | help

	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@thought.org   www.thought.org     Public service Unix




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060322231823.GA23486>