|
Prev: remove from a txt everything between '[' and '] ' (included '[' and'] ')
Next: How to compare a dos text and unix text with diff
From: Jeenu on 3 Apr 2008 11:42 On Apr 3, 8:00 pm, slystoner <slysto...(a)gmail.com> wrote: > from: > [FOOooOoOOO] this is ok1 > [FOOooOOO] this is ok2 > > to: > this is ok1 > this is ok2 > > tnx! :) echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//'
From: slystoner on 3 Apr 2008 12:04 Jeenu ha scritto: > On Apr 3, 8:00 pm, slystoner <slysto...(a)gmail.com> wrote: >> from: >> [FOOooOoOOO] this is ok1 >> [FOOooOOO] this is ok2 >> >> to: >> this is ok1 >> this is ok2 >> >> tnx! :) > > echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//' perfect,tank you! a question: what's the best way to learn the syntax? do you know a good manual or site? (well, a good introduction in my case... eheh!)
From: Jeenu on 3 Apr 2008 12:30
On Apr 3, 9:04 pm, slystoner <slysto...(a)gmail.com> wrote: > Jeenu ha scritto: > > > On Apr 3, 8:00 pm, slystoner <slysto...(a)gmail.com> wrote: > >> from: > >> [FOOooOoOOO] this is ok1 > >> [FOOooOOO] this is ok2 > > >> to: > >> this is ok1 > >> this is ok2 > > >> tnx! :) > > > echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//' > > perfect,tank you! > > a question: what's the best way to learn the syntax? do you know a good > manual or site? (well, a good introduction in my case... eheh!) The core part is to learn Basic regular expressions (BRE), for which there would be plenty of tutorials out there. Rest, it's all similar, be it grep, sed or awk. http://www.regular-expressions.info/ could be a good starting point. Equally good are the manuals for above mentioned programs. |