From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> input number for me that is not to exceed 6 whole digits and 2 decimals.
> regexp {[0-9][0-9]{0,5}(\.[0-9][0-9]} $cost
This says:
one digit, followed by 0-5 digits, but then you have a left paren and no right
paren, followed by a period followed by 2 digits.
Did you perhaps mean:
regexp {^[0-9]{1,5}(\.[0-9][0-9])?$} $cost
which says that the string must be nothing other than a 1-6 digit string,
with an optional period and 2 digits?
#! /usr/tcl82/sun4/bin/tclsh8.2
set decimal {^[0-9]{1,5}(\.[0-9][0-9])?$}
foreach const { "abc" "0" "1.2" ".23" "123.45" "12345.678" } {
set rc [ regexp $decimal $const ]
puts [ list $const " result is " $rc]
}
--
Larry W. Virden <URL: mailto:[EMAIL PROTECTED]>
<URL: http://www.purl.org/NET/lvirden/> <*> O-
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.
-><-
---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).