Forum: Ruby on Rails help needed on validation format

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F4fd473849b71ac9144c11833e551579?d=identicon&s=25 Prashant J. (prashant)
on 2006-12-29 05:29
i want to validate the tesxt in a text box in the format(order) of

i have wrriten the validation format as
validates_format_of :busage ,
                             :with => /\d,(\w+ \s)\,(\d\d:\d\d:\d\d)/ ,
           :message=>"error of dir"

but its still giving error
as its validating date and quantity
but its taking character(\w+) instead of a string  (description)
pls help me out
as whn i put a string in place of description it displays the error

pls help out
jdswift (Guest)
on 2006-12-29 09:01
(Received via mailing list)
I think you want:


That will validate for:
15,Some product description,12:10:06

On Dec 29, 2:29 pm, Prashant Jadhav <>
Eebdb4f45c0055dcb214b8cd9b9d34fb?d=identicon&s=25 Mark N. (mnoten)
on 2006-12-29 10:03
Hi Jadhav,

You better use this pattern:


It will correctly validate the string:

15,Some product description,12:10:06

For validation purposes you don't have to define any capturing groups.
If you want to extract the quantity, description and time then use the


Best regards,

This topic is locked and can not be replied to.