sed and regular expressions problem

Hi

Im trying to use sed to change some files which I'll describe here:

I want to use a regular expression to grab the <body> tag from a document. However, the <body> tag can look different so the regular expression used will take care of that and "include" all types of bodies, in example: <body background="green" > will also be replaced. However, that text that goes directly after body, in this case ' background="green" ' needs to be included in the output.

"s/<body[^>]*>/<body(I want the trimmed content here)>CONTENT/g"

So basically the question is how (and if its possible) to add that content to the output line?
<body background="green" > should become <body background="green" >CONTENT
and
<body> should become <body>CONTENT

If you don't understand what I mean, just ask me and I'll try to describe it in another way:)

Thank you!

This should work

sed -e 's/\(<body.*>\)/\1CONTENT/'

Thanks and it worked as I wanted it to work, however I found a new question after some time..
What if I want the replacement part of 's/regexp/replacement/' to be a file with multiple lines?
s/regexp/`cat filename`/ don't work as it complains about some characters, which I guess depends on the linebreaks.

Thank you!

I would love if someone could help me with this one, if you have any clues:)

did u try "s/regexp/replacement/g" ?