regex - Client side validation, Regext to match tag,or how to validate blog post to prevent script posting -
I was looking for regex to match the speed tag, I used ASP.NET MVC 3.0 humorous recognition I am here.
I get this regexp How to fix this? Here are some examples: Here are some examples: 1) 2) 3) What I'm doing - I want to validate blog post input to stop the post script as a part of the blog post. I think you will match the script tag with simple regex: "^ [[script | (| | | \ N)? & Gt; (| | \ N) *? & Lt; / script & gt;] * $" found
& lt; Script & gt; Warning ("a"); & Lt; / Script & gt; & Lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt;
& lt; Script src = "/ anypath" type = "text / javascript" & gt; Antything & lt; / Script & gt; & Lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt;
& lt; Div style = "clear: both" & gt; & Lt; Br / & gt; & Lt; / Div & gt; & Lt; Script & gt; & Lt; / Script & gt;
(& lt; script. *? & Gt;. *? & Lt; / script & gt;)
Comments
Post a Comment