using this regex export const SPECIALSYMBOLSPATTERN =…
- User
using this regex export const SPECIAL_SYMBOLS_PATTERN = '/^[^:;!?+-,.=(){}[]@"'|/<>*$#\№%^&]*$/g;' I need to 1. perform onPaste event in React, 2. take the text that is going to be copied, 3. apply the regex to it so it would remove all of the special symbols specified in the regex, 4. paste the updated text into the input. How do I do that? If the regex above is incorrect then modify it but explain what exactly is wrong with it.
- Assistant
To achieve the desired functionality, you can follow these steps:
- Create a React component with an input element and attach an
onPasteevent handler to it:
jsx - Create a React component with an input element and attach an