GNU bug report logs - #21865
Parenthesis subexpressions

Previous Next

Package: grep;

Reported by: Valerio Bozzolan <bozzolan.valerio <at> educ.di.unito.it>

Date: Sun, 8 Nov 2015 21:58:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Valerio Bozzolan <bozzolan.valerio <at> educ.di.unito.it>
To: bug-grep <at> gnu.org
Subject: Parenthesis subexpressions
Date: Sun, 08 Nov 2015 21:42:44 +0100
[Message part 1 (text/plain, inline)]
Hi,

(First time in a GNU mailing list!)

I've already asked this question to my local GNU/Linux user group and in #grep <at> 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 want the first subexpression? ("b")? GNU Grep can't do it. Isn't it? (Why?)

I actually use GNU Awk, or GNU Bash with $BASH_REMATCH[$n_sub].

Thank you for the clarification!
--
Valerio Bozzolan
Email sent from Android (CyanogenMod) using K-9 Mail.
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.