You're viewing a comment by Yogesh and its responses.

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 name, if you have one. (I'm @pkrumins, btw.))

Type first 3 letters of your name: (just to make sure you're a human)

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