Regex to escape data to be displayed inside of `::before`

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Regex to escape data to be displayed inside of `::before`



Characters I need to escape: / " spaces ? $ # * + ? ( ) [ ] white space



using this right now: props.text.replace(/[-[]()*+?.,\/^$|#s]/g, '\$&');


props.text.replace(/[-[]()*+?.,\/^$|#s]/g, '\$&');



But the above doesn't escape double quotes.




1 Answer
1



Characters I need to escape / " spaces ? $ # * + ? ( ) [ ] white space


Characters I need to escape / " spaces ? $ # * + ? ( ) [ ] white space



That would be this regex /[/\"s?$#*+?()[]]/


/[/\"s?$#*+?()[]]/






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

Trying to Print Gridster Items to PDF without overlapping contents

Mass disable jenkins jobs