Created
September 5, 2023 16:14
-
-
Save dilaouid/b3edb459860fa8c79049eea0828e6f66 to your computer and use it in GitHub Desktop.
regex for global XSS protection and bbCode check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bbCodeMatch = /\[(b|i|u|s)\](.*?)\[\/\1\]/gs; | |
const XSSMatch = /[<]*<[\s\u200B]*script[\s\u200B]*>.*[/]*[<]*<[\s\u200B]*\/[\s\u200B]*script[\s\u200B]*>/ig; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment