From: Shea Barton Date: 2010-11-11T11:04:45+09:00 Subject: Total string length regex So I have a complicated regex, and I need to have a condition that checks the total number of characters in a string, on top of the other conditions. (this is for a username, to make sure they don't put more than one special character in a row) /^\w(?:\w*(?:[-\.]\w+)?)*$/ How would I limit the total string length for this regex to be between x and y characters? thanks -- Posted via http://www.ruby-forum.com/.