Joined: Tue Mar 27, 2007 10:55 pm Posts: 2272 Location: Earth Has thanked: 39 time Have thanks: 61 time
Following code validate username using pattern regular expression. Max length =10 , min =4 . We check that both numbers and characters.
Code:
<% ' username Dim username Dim regularExpressions = New Regex ' regular expression . With regularExpressions .Pattern = "^[a-zA-Z0-9]{4,10}$" .IgnoreCase = True .Global = True End With username = "asi323" show test against pattern. Response.Write("asi323 tested with pattern ^[a-zA-Z0-9]{3,8}$ :" & regularExpressions.test(username)) %>
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )