bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2.6.3 FEATURE REQUEST: Extend --only-matching to accept submatch


From: Jari Aalto
Subject: 2.6.3 FEATURE REQUEST: Extend --only-matching to accept submatch
Date: Sat, 08 May 2010 15:44:04 +0300

[Cf. https://savannah.gnu.org/bugs/index.php?29827]

Manual page reads:

       -o, --only-matching
              Print only the matched (non-empty) parts  of  a  matching  line,
              with each such part on a separate output line.

FEATURE REQUEST

Extend the option to accept additional numeric argument to control the
submatch returned. (By default 0). This woudl make it possible to run:

    echo "Program version 1.12" | grep -E -o 1 "Program.*([0-9.]+)"

Jari




reply via email to

[Prev in Thread] Current Thread [Next in Thread]