A regex to match that is: ^\$[0-9]\.[0-9]{2}$

Note that $ and . are special regex characters so must be "escaped". It
means this:

^                       start

\$                     dollar sign

[0-9]                  first digit

\.                      Decimal point

[0-9]{2}              second and third digits

$                      end

  _____  

From: Mystic [mailto:[EMAIL PROTECTED]
Sent: Thursday, 1 July 2004 11:51 a.m.
To: CF-Talk
Subject: CFINPUT pattern question

Hello everyone,

I have a form field that I want to use to collect a dollar amount. I am
using CFFORM with the CFINPUT tag and want to use the
[validate="regular_expression"] option with the [pattern="desired pattern "]
option to restrict the input to any dollar value from $0.01 to $9.99. I have
it all done except the needed pattern. _javascript_ regular _expression_ pattern
to validate input. Omit leading and trailing slashes and then it referrs you
to another section of the docs. I looked through the CF docs and found
nothing and then did some google searches for it and although I found a ton
of info on regex I was unable to find how to write the pattern.

Can anyone point me to a place to get this info?

Thanks,
Kevin

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to