If you'd like to be a little more careful about which instances of the original string are replaced, add the 'c' option to the end to enable checking:
Replacing text around a string can be accomplished with a regex:
The command above replaces lines of the form abcblah; with defblah; preserving the blah, whatever it may be. The escaped parentheses form a regex group and can be referenced later using \1, \2, \3, etc. (the number corresponding to the group).