$buffer = "#bla bla bla#"
$var = ereg_replace("#([[:alnum:]]+)#", " ", $buffer);
This one works with #blablabla# but not with #bla bla bla# ?
because [:alnum:] does not include spaces. try this:
$var = ereg_replace("#([ [:alnum:]]+)#", " ", $buffer);
Notice the space before [:alnum:]