Expand an environment variable in sed, when the variable contains a slash

I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash".

sed -e 's/<HOME_DIRECTORY>/'$HOME'/'

This gives me the following error:

sed: -e expression #1, char 21: unknown option to `s'

Obviously this is because of the slashes in the HOME variable. How do I get around this problem?

sed -e "s#<HOME_DIRECTORY>#$HOME/#"

So, the delimiter can be any (single-byte) character? I never knew that. Thanks a bunch!:b: