16. januar 2004 - 14:26
#10
Nu har jeg en løsning. Men det er godt nok ikke RegExp, men blot en alm. funktion:
<%
Function letterTest(streng)
bigFound = 0
smallFound = 0
large = Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z", "Æ", "Ø", "Å")
small = Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z", "æ", "ø", "å")
For i=0 to 28
If Instr(1, streng, large(i)) then
bigFound = bigFound + 1
End if
If Instr(1, streng, small(i)) then
smallFound = smallFound + 1
End if
next
If bigFound <> 0 AND smallFound <> 0 then
Response.Write "Der blev fundet både store og små bogstaver."
else
Response.Write "Din streng skal indeholde både store og små bogstaver."
End if
End Function
%>
Du kan så kalde den sådan her:
letterTest("HEj mEd dIG")