From: Scott Gonyea Date: 2010-11-11T11:50:16+09:00 Subject: Re: Total string length regex Pretty sure you can repeat "validates_format_of" as much as you like. Regular expressions should always be broken up into simpler, easy to understand, chunks. Especially when you're validating user names and the like. If you do smash it all together, you write tests for all of your edge cases and point that at a constant, containing your regex, at the top of your model. To strengthen your regex muscles: http://rubular.com/ Scott On Nov 10, 2010, at 6:27 PM, Shea Barton wrote: > I know I could do it withs several lines of ruby, but I'd really like to > have it contained all within a single regex, as I am using it with > validates_format_of :with => /.../ in rails. > > -- > Posted via http://www.ruby-forum.com/. >