Javascript Regex Whitelist with character limit
I'm trying to add a character limit clause to this white list regex approach

    str = str.replace(/[^A-Za-z-_0-9 ]/g, "");

Is it possible and how do I do it?
Javascript Regex Whitelist with character limit
===

I'm trying to add a character limit clause to this white list regex approach

    str = str.replace(/[^A-Za-z-_0-9 ]/g, "");

Is it possible and how do I do it?