regex for input number and . allowing commas -
i have form submission have person enter amount.
i have working fine reject $ , numbers allowing commas , cannot seem stop doing this.
the code coldfusion not cf issue regex one.
<cfinput type="text" name="sp_price" value="0" message="add-on price - numbers only" validate="regular_expression" pattern="^[0-9].*$" required="no" size="5">
accepts 1000 1000.00 , 1,000.00 , 1,000 , don't want commas accepted.
thanks in advance andy
if want exclude characters, format [^,]
example:
pattern="^([0-9]|[^,$\w])*$"
edit: excludes dollar , word characters https://regex101.com/r/tk5zu7/1
Comments
Post a Comment