On 10 Aug 2012, at 8:42 AM, Rob_McC <mrmccorm...@gmail.com> wrote: > To make is same as google user name policy: > They allow periods, but NOT as a first letter - I added to your RegEx > I'm almost got it, I want to use exactly what Google uses, (see image > attached) - I bet this could be on RegEx, but won't have separate messages > then. > > auth.settings.table_user.username.requires = [IS_NOT_IN_DB(db, > auth.settings.table_user.username), > IS_LENGTH(30,6,'must be between 6-30 letters'), > IS_MATCH('[.a-z].*', error_message='lower case only and periods only'), > IS_EXPR("value[:1]<>'.'", error_message='User name can\'t start with > period'), > IS_EXPR("value.find(' ') < 0", error_message='User name can\'t contain > spaces'), > IS_EXPR("value.find('-') < 0", error_message='User name can\'t contain > dashes'), > IS_EXPR("value.find('_') < 0", error_message='User name can\'t contain > underscores'), > ] > > I'll keep testing, thanks > Rob >
'[.a-z].*' is probably too permissive, or the error message is wrong. Do you mean "User name must start with lower case or a period"? (Does Google really forbid upper case?) The message "lower case only and periods only" is confusing; it sounds like that's the rule for the entire name. Is that right? "User name can't contain hyphens": double quotes make the apostrophe --