buggrep - Bugs: bug #29827, 2.6.3 FEATURE REQUEST: Extend...


You are not allowed to post comments on this tracker with your current authentication level.

bug #29827: 2.6.3 FEATURE REQUEST: Extend --only-matching to accept submatch

Submitted by:  Jari Aalto <jaalto>
Submitted on:  Sat 08 May 2010 12:42:03 PM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Sun 09 May 2010 02:00:09 PM UTC, comment #1: 

For backwards compatibility the optional argument could only be added to the long option; with that caveat I like this change.

Paolo Bonzini <bonzini>
Sat 08 May 2010 12:42:03 PM UTC, original submission:  

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.


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 Aalto <jaalto>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by jaalto (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7