Guest User

Untitled

a guest
Apr 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 0.54 KB | None | 0 0
  1. 'validate.asp?value=pipe pipe ---- or ------- validate.asp?value=àèìù+è MUST NOT BE VALID
  2.  
  3. function ereg(strOriginalString, strPattern, varIgnoreCase)
  4.  
  5.     dim objRegExp : set objRegExp = new RegExp
  6.         with objRegExp
  7.         .Pattern = strPattern
  8.         .IgnoreCase = varIgnoreCase
  9.         .Global = True
  10.         end with
  11.         ereg = objRegExp.test(strOriginalString)
  12.         set objRegExp = nothing
  13. end function
  14.  
  15.  
  16. if ereg(usern, "^[a-zA-Z0-9]+$", True) = True then
  17.     response.write "No special characters allowed."
  18.     else
  19.     response.write "Valid."
  20.     end if
Add Comment
Please, Sign In to add comment