Re: sed html tags

2008-08-28 Thread Joseph Olatt
snip Hi, I have the string span 111 /span span /span And i wish to use sed to strip *only* the span tag and its contents... is this possible ? I'm trying this expression, but it doesn't work... sed 's/span [^\(/span\)]+\/span//g' file

Re: sed html tags

2008-08-28 Thread An
yes, it does work perfectly with the example I gave... the actual file is some like ... span 111 span www no /span /span span yyy /span span yyy /span ... your command only returns ]# sed 's/\(span .*.*\/span\)\(.*\)\(span .*.*\/span\)/\2/' file I wish to

Re: sed html tags

2008-08-28 Thread Joseph Olatt
On Thu, Aug 28, 2008 at 03:04:22PM -0400, An wrote: yes, it does work perfectly with the example I gave... the actual file is some like ... span 111 span www no /span /span span yyy /span span yyy /span ... your command only returns ]# sed 's/\(span

Re: sed html tags

2008-08-26 Thread Yuri Pankov
An wrote: unfortunately not... see: # cat file span 111 /span span /span # sed -e 's/\/?span[^]*//g' file span 111 /span span /span (...nothing happens, the file is returned with no substitutions done) I could do it with a perl script, which

Re: sed html tags

2008-08-26 Thread An
Well, thanks, Yuri ! That worked much better than all that i had done ! But i have the problem that I don't know what characters to expect... accents, ñ, etc... So i really need a get everything between the span and the first /span... Regarding perl, it is perfect ! thanks ! The ? is

sed html tags

2008-08-25 Thread siran
Hi, I have the string span 111 /span span /span And i wish to use sed to strip *only* the span tag and its contents... is this possible ? I'm trying this expression, but it doesn't work... sed 's/span [^\(/span\)]+\/span//g' file is there anything like it ? I

Re: sed html tags

2008-08-25 Thread Paul A. Procacci
siran wrote: Hi, I have the string span 111 /span span /span And i wish to use sed to strip *only* the span tag and its contents... is this possible ? I'm trying this expression, but it doesn't work... sed 's/span [^\(/span\)]+\/span//g' file is there anything

Re: sed html tags

2008-08-25 Thread An
unfortunately not... see: # cat file span 111 /span span /span # sed -e 's/\/?span[^]*//g' file span 111 /span span /span (...nothing happens, the file is returned with no substitutions done) I could do it with a perl script, which basically does what i