javascript - Java/Spring : Form validation to avoid URLs as input -
we have form user enters firstname, lastname , address. users entering firstname/lastname website.
ex: www.google.com, google.com or other spam site.
is there way validate these kind of inputs?
note : don't want replace or avoid special characters causing issues when people enter name in different language other english.
those "some users" hackers penetration testing web site.
use regular expression filter out fake names match pattern. name start http://
or www.
? name end in .com
or .net
? if so, don't allow users enter name.
if google "regular expression url matching", should plenty of examples of regular expressions match url strings. need validation not allow names match url regex, , conversely, allow names don't match.
Comments
Post a Comment