how to get only alphanumeric and whitespace in string regex code example Example: how to get only alphanumeric and whitespace in string regex /[A-Za-z\d\s]/g