Closed
Description
Hello everyone, I'm having an issue with my regular expression. How can I make it accept the use of hashtags without compromising security? I'm trying to implement this regular expression, but whenever I attempt, I receive an error.
My code
'patterns' => [
// Allow only hashtags
'#(?<![[:alnum:]])#\w+#',
// Add your other patterns for protection against XSS below:
// Evil starting attributes
'#(<[^>]+[\x00-\x20\"\'\/])(form|formaction|on\w*|style|xmlns|xlink:href)[^>]*>?#iUu',
// javascript:, livescript:, vbscript:, mocha: protocols
'!((java|live|vb)script|mocha|feed|data):(\w)*!iUu',
'#-moz-binding[\x00-\x20]*:#u',
// Unneeded tags
'#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base|img)[^>]*>?#i'
],
any idea to solve this?
Error preg_match(): Unknown modifier ''
Metadata
Metadata
Assignees
Labels
No labels