Need Help with Sed

If I have this command string:

sed '2,6 s/Mary/Sue/g' dear.john

It replaces Mary with Sue in lines 2 thru 6 in the file called dear.john
But in line 6 you have the word Maryland which it replaces with Sueland. Is there anything that I can put in the command string that will change all the Mary's to Sue's but not change not change Maryland to Sueland?

Also is there a way to shorten this command and make it show only the output and not the whole file? I think I'm just putting the flag -n in the wrong place.Am I on the right track?

sed -e '4,8d' -e 's/Mary/mary/g' -e 's/Bill/bill/g' dear.john

Thanks

JJ

Very easy if the instances of "Mary" are followed with a certain character...such as a space, or a delimeter like a tab or a comma.

Just add a space in your seb arguements - and make sure you add one after the Sue as well....

s/Mary /Sue /g

This will not relpace Maryland with Sueland as there is no instance of "Mary " in these lines.