To clarify:
<%
Function TestForNumerals( _
ByVal varExpressionToTest _
)
Dim objRegExp
Set objRegExp = New RegExp
' ^ means start of string has to be here
' /d+ means 1 (or more digits)
' $ means end of string needs to be here
objRegExp.Pattern = "^\d+$"
TestForNumerals = objRegExp.Test(varExpressionToTest)
End Function
'
'
' Will return True:
TestForNumerals("1234675489")
'
' Will return false
TestForNumerals("1,000")
%>
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ken Schaefer" <[EMAIL PROTECTED]>
Subject: Re: Test for Numbers
: Regular Expressions are your friend :-)
:
: Download the VBScript docs:
:
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-
: US/scrdoc56en.exe
: and look in the RegExp Syntax entry: /d matches any digit.
:
: Cheers
: Ken
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: "Johnny Martinez" <[EMAIL PROTECTED]>
: Subject: Test for Numbers
:
:
: : Hi all,
: : I am having trouble coding to make sure the user only submits numbers in
a
: : form field.
: :
: : IsNumeric(strVar) is returning true if I submit 14,000 or $134. I only
: want
: : numbers submitted.
: :
: : Any tips?
:
: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]