Hi Jsn7821,
I'm not absolutely sure you regex does what you want it to (you require all that special characters to occur at the end if the do occur instead of adding them to the character class of allowed characters).
Anyway, I think the posix style regex may not support the \S syntax (though there probably is an equivalent), but why not simply switch to perl-style which definitely supports \S?
using preg_replace instead of ereg_replace is not too hard, you only need to wrap the pattern into delimiters. Commonly a slash is used, but whatever you use needs to be escaped within the pattern, so e.g. ยง as delimiter may be more convenient here.
[edit: partly fixed my English :S]