@Mohamed Hameed21513110
That appears to be a literal hyphen character, not a "metacharacter".
To delete anything that is not an upper/lowercase alphabetical letter, number, hyphen, underscore or space:
.replace(/[^A-Za-z0-9-_ ]/g, '');
Basically, whatever literal character inside the [^] is retained. You are specifying what to keep, with everything not explicitly set removed.
The input string of:
MY TEXT! @ # $ % ^ & *
Would result in:
MY TEXT
However, there would be some consecutive garbage word spaces left at the end, therefore, a second regex cleanup would be required:
.replace(/ +$/g, '');
That being said, regex is very much case-dependent, so generic replies as above may or may not be 100% successful without real examples.