You're replying to a comment by Anirudh.

Anirudh Permalink
February 02, 2016, 03:44

>> $ echo "this is foo and foo another foo quux" | sed 's/foo\(.*foo\)/bar\1/'

Umm, what about this?

$ echo "this is foo and foo  another foo quux" | sed -e 's/foo/bar/'

This replaces the first occurrence of "foo" with "bar".

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "network_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.