You're replying to a comment by Yogesh.

February 13, 2009, 12:34

In #31, if the pattern (foo) comes more than two times in the line then it replaces the second last one. As an example

echo "this is first foo, this is second foo another foo quux" | sed 's/\(.*\)foo\(.*foo\)/\1bar\2/'

then output will be:
this is first foo, this is second bar another foo quux

Which doesn't fulfill our requirements.

Regards,
Yogesh

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

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

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