Is there a way to tell sed to output only captured groups?

For example, given the input:

This is a sample 123 text and some 987 numbers

And pattern:

/([\d]+)/

Could I get only 123 and 987 output in the way formatted by back references?

11 Answers
11

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *