2009/9/20 Wang Pengcheng <[email protected]>: > Thanks for your words. > I am sorry for my words. > /\A[\d\w]+\Z/im
I think the point of the OP's post was that he wanted the user to have to enter alphabetic _and_ numeric characters, not to limit them to only those characters. Colin > > 2009/9/20 Felix Schäfer <[email protected]> >> >> >> Am 20.09.2009 um 05:46 schrieb Wang Pengcheng: >> >> > First , please use the white list not the black list in the regex. >> > Second, please validate the length of the input data. >> > >> > /^[\d\w]+$/i >> >> As a side note, and if you insist on being pedantic, I'd suggest using >> \A and \Z to delimit the beginning and the end of the whole string in >> the regex, as opposed to ^ and $ only matching the beginning and the >> end of a line in ruby, who knows, maybe one your users will try to use >> a password with a newline in it ;-) >> >> Felix >> >> > > > > -- > Code our future > Name : Wang Pengcheng > Nick : QJGui > > Sent from Wuhan, 42, China > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

