bug#21865: Parenthesis subexpressions

2015-11-09 Thread Stephane Chazelas
2015-11-09 17:00:36 +0100, Valerio Bozzolan: > Thanks for agreeing with the evolution of the meaning of "-o". > > Just to make you a laugh: I was reproducing egrep with $BASH_REMATCH: > https://gist.github.com/valerio-bozzolan/6787675e931dce1ba7e9 > > Definitely not beautiful... but really effect

bug#21865: Parenthesis subexpressions

2015-11-09 Thread Valerio Bozzolan
Thanks for agreeing with the evolution of the meaning of "-o". Just to make you a laugh: I was reproducing egrep with $BASH_REMATCH: https://gist.github.com/valerio-bozzolan/6787675e931dce1ba7e9 Definitely not beautiful... but really effective for me. So something like "egrep -o $n regex" also c

bug#21865: Parenthesis subexpressions

2015-11-09 Thread Stephane Chazelas
2015-11-08 21:49:03 +0100, Valerio Bozzolan: > Sorry... typo... > > echo abcde | grep -o -E 'b([a-z])d' > => "bcd" > > Can't I choose to have only "c"? [...] That's correct, GNU grep doesn't have that capability (yet). Recent versions of pcregrep do: $ echo abc | pcregrep -o1 '.(.).' b

bug#21865: Parenthesis subexpressions

2015-11-08 Thread Valerio Bozzolan
Sorry... typo... echo abcde | grep -o -E 'b([a-z])d' => "bcd" Can't I choose to have only "c"? Thanks again! On 8 November 2015 21:42:44 CET, Valerio Bozzolan wrote: >Hi, > >(First time in a GNU mailing list!) > >I've already asked this question to my local GNU/Linux user group and >i

bug#21865: Parenthesis subexpressions

2015-11-08 Thread Valerio Bozzolan
Hi, (First time in a GNU mailing list!) I've already asked this question to my local GNU/Linux user group and in #grep@Freenode... I'm still confused. GNU Grep don't have an arg to choose the subexpression. Right? Stupid e.g.: echo abcde | grep -o -E 'b([a-z])d' => "bcd" What if I wan