If you don't mind regexes, the regex that matches the opening is
/\[caption[^]]*\]/
http://rubular.com/r/eRRxYIsVCG
remember to specify case insensitivity if you're going to have caption
and CAPTION
, etc.
if you just want to do this on the command line you can use sed(1)
sed 's/\[caption[^]]*\]/<div class=\\"sss\\">/g' file.html
which sends it to stdin, which you can pipe to whatever file you want.
if you want to modify the file in-place you can add the -i
switch to sed
.