POV-Ray : Newsgroups : povray.off-topic : sed question : Re: sed question Server Time
6 Sep 2024 17:18:49 EDT (-0400)
  Re: sed question  
From: Jim Holsenback
Date: 17 Nov 2008 12:21:00
Message: <4921a7fc@news.povray.org>
"triple_r" <nomail@nomail> wrote in message 
news:web.4921949ae31b5110866b6f750@news.povray.org...
> I think the problem is that you need to use \( \) and a \1 to correctly 
> extract
> that portion of the text.  I have success with:
>
> sed -e 's%<indexentry "\([^"]*\)">%<!-- <indexentry "\1"> -->%g'

Yes ... this works! I'd given up flogging at this and decided to go back to 
basics. I have a book that covers sed and awk so I did some reading and 
decided that I was at least getting a match of sorts with my first stab at 
it because of the results. The grouping with () and the refernce to \1 and 
\2 (pattern/hold buffer) was something covered in the book. Your live 
working example pulled it all togeather for me .... Thanks!

Jim


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.