Hi.
I’ve got this php code
protected function sanatizeInputValue($value)
{
$dodgychars = "#[|\\!\\"'\\$£%&\\/()=?^<>\\*\\+\\-]#";
$filterValue = preg_replace($dodgychars,"-",$value);
return substr($filterValue,0,255);
}
How can I tanslate this in js code 
I tried but with very poor result 
can you show me the way, please ?
Bye
var toReplace = {
'|': '-',
'!': '-',
'"': '-',
'£': '-',
'%': '-',
'&': '-',
'/': '-',
'(': '-',
')': '-',
'=': '-',
'?': '-',
'^': '-',
'*': '-',
'°': '-',
'*': '-',
'§': '-',
'@': '-',
'#': '-',
'_': '-',
';': '-',
':': '-',
'!': '-',
'.': '-',
'<': '-',
'<': '-',
};
var string = '<This ?^*ù is a test'.replace(/./g, function (match) {
return toReplace[match] || match;
});
alert(string);

I’m lucky I found it in my repository
I don’t remember the really author 
JimmyP
3
function sanatizeInputValue(value) {
var dodgyChars = /[|!"'$£%&\\/()=?^<>*+-]/g;
return value.replace(dodgyChars, '-').substring(0, 255);
}
Thanks for the help
It was my first attempt but
it didn’t work may be for the lack
of the modifier 
Bye